Re: Weird query plan - Mailing list pgsql-general

From Dmitry Tkach
Subject Re: Weird query plan
Date
Msg-id 3F68BC68.3050400@openratings.com
Whole thread Raw
In response to Re: Weird query plan  (Dmitry Tkach <dmitry@openratings.com>)
Responses Re: Weird query plan
List pgsql-general
> P.S. I also tried to look at the stats of that other database I
> mentioned... The stats for b look similar:
> stavalues1  |
> {1028104,25100079,50685614,78032989,105221902,135832793,199827486,611968165,807597786,884897604,969971779}
>
>
> But the stats for a are just *not there at all* (is it even possible?)
> Could it be the reason why it works on that database (because it uses
> the default stats instead of the real thing)?
>


I  ran 'analyze a;' on that database...
I now have the same problem with it, but the other way around - the
query with a condition on a  runs quickly, and one with a condition on b
does not... and the query plans are the same, and have a as outer table...
The new stats for a look like:


stavalues1  |
{1003284,61663485,126262679,211106732,300624079,392709544,469196539,572479496,697890767,842087009,989170923}


... but actually, I never tried it with a condition on b on that
database before analyze :-(
I just tried the "a - variant" (the one that wasn't working originally),
and it worked...
Now, I tried deleting all the entries for a from pg_statistic, and
running the b-variant... and it still doesn't work.

So, it probably has nothing to do with that analyze I ran...

Dima


pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: psql and blob
Next
From: Alvaro Herrera
Date:
Subject: Re: Where are PL/pgSQL functions stored?