Re: JOINS and non use of indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: JOINS and non use of indexes
Дата
Msg-id 20623.1018277168@sss.pgh.pa.us
обсуждение исходный текст
Ответ на JOINS and non use of indexes  ("Ian Cass" <ian.cass@mblox.com>)
Список pgsql-sql
"Ian Cass" <ian.cass@mblox.com> writes:
> I'm transferring a database & reporting scripts across from Oracle & a few
> of the SQL statements behave a little differently with regards to indexes.
> The one that's got me stumped at the moment is this...

> select * from messages, statusinds
> WHERE statusinds.gateway_id = messages.gateway_id
> AND (messages.client_id = '7' AND messages.user_name in ('U66515'))
> limit 5;

> (tables_YYYYMM are inherited)

There's your problem (and don't tell me Oracle gets this right; they
don't do inheritance, do they?).  The planner isn't smart about
indexscan-based joins for inheritance trees.  This could possibly be
improved with some work, but I haven't thought about the details.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Ian Cass"
Дата:
Сообщение: Re: JOINS and non use of indexes
Следующее
От: "Ian Cass"
Дата:
Сообщение: Re: JOINS and non use of indexes