Re: Weird query plan - Mailing list pgsql-general

From Tom Lane
Subject Re: Weird query plan
Date
Msg-id 4970.1063827252@sss.pgh.pa.us
Whole thread Raw
In response to Re: Weird query plan  (Dmitry Tkach <dmitry@openratings.com>)
Responses Re: Weird query plan
List pgsql-general
Dmitry Tkach <dmitry@openratings.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

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: State of Beta 2
Next
From: david_shadovitz@xontech.com (David Shadovitz)
Date:
Subject: Where are PL/pgSQL functions stored?