HypoPG / hypopg

Hypothetical Indexes for PostgreSQL
https://hypopg.readthedocs.io
Other
1.39k stars 59 forks source link

Fix for hash partitioning estimate #28

Closed yuzupy closed 6 years ago

yuzupy commented 6 years ago

This includes these modifications.

  1. Estimate RelOptInfo rel->tuples: in the case of hash partitioning, rel->tuples are computed using the number of partitions, instead of partition bound.
  2. Forbid hypo_analyze() on hypothetical partitioning
  3. Fix the regression test
rjuju commented 6 years ago

Great, thanks!

One side note: there's no guarantee that users will create all the partitions in case of hash partitioning, so maybe just using partdesc->nparts is not the best heuristic for this estimate. I'm not sure that this is a case we have to make work very reliably though.