Re: Weird query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: pg_general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weird query plan
Date: 2003-09-17 19:34:12
Message-ID: 4970.1063827252@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dmitry Tkach <dmitry(at)openratings(dot)com> writes:
> Also, I have another copy (not exact copy, but identical schema, and
> similar content... but about twice smaller) of the original database...
> I tried my query on it, and it works right too.

> So, there must be something wrong with that particular database I suppose...

Hmm. Take a look at the pg_stats statistics for the id columns in each
case. Could the ones for the misbehaving tables be out of whack
somehow? I'm wondering for example if the planner discounted the >=
condition because it thought it would match all the rows.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-09-17 19:40:40 Re: psql and blob
Previous Message Dmitry Tkach 2003-09-17 19:32:59 Re: Weird query plan