pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ian Cass <ian.cass@mblox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: JOINS and non use of indexes
Date: Mon, 08 Apr 2002 10:46:08 -0400
Message-ID: <20623.1018277168@sss.pgh.pa.us> (raw)
In-Reply-To: <002001c1def9$e0fcc750$6602a8c0@salamander>
References: <002001c1def9$e0fcc750$6602a8c0@salamander>

"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



view thread (8+ messages)  latest in thread

Message-ID: <20623.1018277168@sss.pgh.pa.us>
Permalink:  ../20623.1018277168@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20623.1018277168@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ian.cass@mblox.com
  Subject: Re: JOINS and non use of indexes
  In-Reply-To: <20623.1018277168@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox