Re: [PERFORM] Bad Planner Statistics for Uneven distribution.

2006-07-22 Thread Tom Lane
"Guillaume Smet" <[EMAIL PROTECTED]> writes: > Isn't there any way to make PostgreSQL have a better estimation here: > -> Index Scan using models_brands_brand on models_brands > (cost=0.00..216410.97 rows=92372 width=0) (actual time=0.008..0.008 > rows=0 loops=303) >Index Cond: (brand

Re: [PERFORM] Bad Planner Statistics for Uneven distribution.

2006-07-21 Thread Guillaume Smet
Tom, On 7/21/06, Tom Lane <[EMAIL PROTECTED]> wrote: It's really not possible for a full-table indexscan to be faster than a seqscan, and not very credible for it even to be approximately as fast. I suspect your second query here is the beneficiary of the first query having fetched all the pages

Re: [PERFORM] Bad Planner Statistics for Uneven distribution.

2006-07-21 Thread Tom Lane
"Kevin McArthur" <[EMAIL PROTECTED]> writes: > -> Seq Scan on models_brands (cost=0.00..6411.89 rows=369489 > width=4) (actual time=0.040..1352.997 rows=369489 loops=1) > ... >-> Index Scan using models_brands_brand on models_brands > (cost=0.00..862236.96 rows=369489 width=4) (a

[PERFORM] Bad Planner Statistics for Uneven distribution.

2006-07-21 Thread Kevin McArthur
I discussed this with a few members of #postgresql freenode this morning. I'll keep it breif; [note: i have cleaned out columns not relevant]   I have two tables, brands and models_brands. The first has about 300 records, the later about 350,000 records. The number of distinct brands in the