[Bizgres-general] Optimizer: Default assumption of table size
Simon Riggs
simon at 2ndquadrant.com
Thu Oct 20 20:27:10 GMT 2005
On Sat, 2005-10-15 at 21:47 -0700, Luke Lonergan wrote:
> All you optimizer guys: Is there a downside to making the assumption that
> tables are 2x the size of available RAM (in ipc/shmem)? If so, what is it?
Optimizing for small tables is important in the presence of very large
tables. Any uniform assumption of table size would produce wrong answers
in a large number of cases.
> >From what we (Joan Hoenow and I) can tell, the current PostgreSQL assumption
> that tables are size 1 row unless proven otherwise is appropriate for an
> OLTP type environment where tables start at 0 and grow over time (or not)
> and the nested loop join plan would be the best for tiny tables.
This was altered in a later stage release of 8.0.x, IIRC
cvstip of PostgreSQL checks the number of blocks in the table, then
multiples by the last known tuple-density-per-block.
Where are you looking in the code, so I can validate?
I'll locate the appropriate patch for you, if that is the case.
Best Regards, Simon Riggs
More information about the Bizgres-general
mailing list