Search Postgresql Archives

Re: Wrong estimate in query plan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eelke Klein wrote
> What I noticed is that are no most common values mentioned ofcourse the
> value 1 only occurs once in the column but as all other values are NULL
> you
> could argue it is a common value.

A random sampling is unlikely to choose a record that only appears in 0.1
percent of the table.

Two sequential scans plus a hash seems like a good plan.

The smaller table is so small a sequential scan is fast. The larger table
experts to have all records read so it to should be scanned.  Combining with
a hash seems sound.  The fact the cross-column estimate is way off isn't
that big a deal though I'd be curious to hear Tom's opinion on why this is
so for educational purposes.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Wrong-estimate-in-query-plan-tp5775727p5775785.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux