Re: JOINS and non use of indexes - Mailing list pgsql-sql

From Tom Lane
Subject Re: JOINS and non use of indexes
Date
Msg-id 20623.1018277168@sss.pgh.pa.us
Whole thread Raw
In response to JOINS and non use of indexes  ("Ian Cass" <ian.cass@mblox.com>)
List 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 by date:

Previous
From: "Ian Cass"
Date:
Subject: Re: JOINS and non use of indexes
Next
From: "Ian Cass"
Date:
Subject: Re: JOINS and non use of indexes