Hello everyone!
I'm seeking answers for the following questions. Looking forward to hearing from you all.
--
---------- Forwarded message ---------
From: Sumit Chaturvedi <sumit.chaturvedi@xxxxxxxxx>
Date: Sun, Oct 14, 2018 at 8:50 PM
Subject: Query Optimizer Postgresql
To: <bruce@xxxxxxxxxx>
Cc: Adwait Godbole <godbole15@xxxxxxxxx>, Nilay Pande <nilay017@xxxxxxxxx>, <nitishj@xxxxxxxxxxxxxx>
From: Sumit Chaturvedi <sumit.chaturvedi@xxxxxxxxx>
Date: Sun, Oct 14, 2018 at 8:50 PM
Subject: Query Optimizer Postgresql
To: <bruce@xxxxxxxxxx>
Cc: Adwait Godbole <godbole15@xxxxxxxxx>, Nilay Pande <nilay017@xxxxxxxxx>, <nitishj@xxxxxxxxxxxxxx>
Hello Sir
My friends and I are trying to come up with an experimental implementation of Join Optimization within PostgreSQL. We have a few questions about the code and will be grateful if you could address them.
We found that the dynamic programming algorithm is implemented in standard_join_search(). We realized that the optimal path is stored in the cheapest_path field in the RelOptInfo struct that is returned.
Since in our implementation, we are only trying to optimize on the join order, we were wondering what all changes would we need to make without breaking the code? In other words, what additional state would we need to modify if we were to rewrite the standard_join_search() method such that everything works out well.
Thank You
My friends and I are trying to come up with an experimental implementation of Join Optimization within PostgreSQL. We have a few questions about the code and will be grateful if you could address them.
We found that the dynamic programming algorithm is implemented in standard_join_search(). We realized that the optimal path is stored in the cheapest_path field in the RelOptInfo struct that is returned.
Since in our implementation, we are only trying to optimize on the join order, we were wondering what all changes would we need to make without breaking the code? In other words, what additional state would we need to modify if we were to rewrite the standard_join_search() method such that everything works out well.
Also, since our implementation would need the stats generated by ANALYZE command, what interface is available for that. For example I noticed the function call set_cheapest(rel). Can I simply use this call once I have populated my RelOptInfo->pathlist and accept it to consult the statistics and appropriately populate RelOptInfo->cheapest_path.
Finally, what additional care should we take to handle queries containing asymmetric joins or joins in subqueries?
By the way, I have watched your talks on Postgres Internals and the Query Optimization Engine and as a student of databases, I find them enlightening.
Thank You
--
Sumit Chaturvedi
Sumit Chaturvedi