zhouqingqing / qpmodel

A Relational Optimizer and Executor
MIT License
64 stars 18 forks source link

[research] collection #196

Open zhouqingqing opened 3 years ago

zhouqingqing commented 3 years ago
  1. parameter query select * from a where i > ?

depending on ?'s actual value, we may have indexed or sequential scan. Say we want to cache the plan by PREPARE command, question is (1) how many plans we want to cache? (2) how to fast and accurately decide which plan to use when ? is given?

See https://www.postgresql.org/docs/current/sql-prepare.html for backgrounds.

  1. query re-optimization

Classic wisdom is that first optimization then exec following plan. The problem is obvious because optimizer can be wrong. If executor can call optimizer during the middle of execution, then optimizer can get a chance to re-optimize and may generate better plan. The reopt could be small (swap hash join sides, etc) or big (total plan shape shuffle). Problems are: (1) when to invoke reopt? (2) will it cause unstable or even slower performance?

See Spark's AQP.

  1. other issues
    • 105 (research items there)

    • 110

    • incrementally maintain stats (upon updates, when and how)