> 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