Details
-
Type:
Task
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Fix Version/s: 10.2
-
Component/s: None
-
Labels:None
Description
The idea is to use the data obtained by "ANALYZE statement" (MDEV-406) for query optimization. In order for that to work, we will need to
1. Save the ANALYZE data somewhere where we could access it
2. Reuse that data in optimization
== Saving ANALYZE data ==
After MDEV-406, the data will be saved into the slow query log. The problems are
- There is no way to read that data back in the server
- Even if we implement reading, we will only be able to read the file sequentially.
== Reading and reusing the data ==
At the moment the idea is to re-use execution data for re-running the same query. Reuse will go as follows:
- We get a query
- We find ANALYZE data for this query (we could also try using ANALYZE data
from the queries that matched the same query pattern) - We optimize the query, making the optimizer to take into account the real
table read costs and selectivities. - This can result in the same query plan or in a different query plan..
TODO: elaborate further.
== Questions ==
- Do we need to save just the ANALYZE output (i.e. EXPLAIN + actual execution data), or it should be some other kind of data that can be reused by the optimizer? (current answer: just EXPLAIN)
- How exactly can saved data be used? (Current answer: we have precis selectivity/fanout numbers for the join order that was picked)
- Do we use data collection/re-feeding for all queries or for some of them only?
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions