Re: Weird query plan

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2003-09-17 20:03:34 Re: Where are PL/pgSQL functions stored?
Previous Message Jonathan Bartlett 2003-09-17 19:48:46 Re: psql and blob