zhouqingqing / qpmodel

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

add sampling based estimation #54

Open zhouqingqing opened 4 years ago

zhouqingqing commented 4 years ago
-> PhysicScanTable lineitem (cost=6005, rows=1) (actual rows=116)
    Filter: l_shipdate[10]>='1994-01-01' and l_shipdate[10]<'1/1/1995 12:00:00 AM' and l_discount[6]>=0.05 and l_discount[6]<=0.07 and l_quantity[4]<24

https://github.com/naru-project/naru - we can consider add a service to wrap it and the adb core shall consulting it for card estimation.

zhouqingqing commented 4 years ago

let's start with sampling based ANALYZE command implmentation.

zhouqingqing commented 4 years ago

Here is how I think it can implemented:

  1. Introduce a sampling scan (vs. current full scan with LogicTableScan/PhysicTableScan) , both logic and physic node;
  2. Use sampling scan for ANALYZE statement.
  3. In this way, we have minimal change in analyze building histogram , mcv implementation.