1 / 13

Caching All Plans with Just One Optimizer Call

Caching All Plans with Just One Optimizer Call. Debabrata Dash, Ioannis Alagiannis, Cristina Maier, Anastasia Ailamaki. Goal: A Physical Designer for PostgreSQL. Automatically suggest indexes, views, partitions, etc. Essential in modern DBMSs Provide improved performance

talia
Download Presentation

Caching All Plans with Just One Optimizer Call

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Caching All Plans with Just One Optimizer Call Debabrata Dash, Ioannis Alagiannis, Cristina Maier, Anastasia Ailamaki

  2. Goal: A Physical Designer for PostgreSQL • Automatically suggest indexes, views, partitions, etc. • Essential in modern DBMSs • Provide improved performance • Reduce administration costs • All major commercial DBMSs provide one • Not available on open source systems • Higher administration cost

  3. Query Cost? Q a a Optimal Plan Candidate set of Indexes a Cost:120 Typical Physical Designer Cost Model Too Slow Automated design tool Query Optimizer Need a faster cost model to search through the candidates scalably.

  4. Plans for query Q Placeholders for data access Join methods Join order c a b Q a Request a c b b c a INUM Cache INUM: A Fast Cost Model Cost Model Index Selection Tool Query Optimizer Matching Logic a Cost:120 Once the cache is built, the cost model is very fast!

  5. INUM Cache structure • Plans are indexed by Interesting Orders (IntOrd) • Columns which help in query performance when sorted [Selinger79] • Grouping, joining, ordering columns • Indexes provideIntOrds, plans require them • Hundreds of these IntOrd combinations per query Potentially hundreds of optimizer calls  High startup overhead

  6. Requirement: INUM with fast startup On Violation  Rebuild cache Needs fast cache rebuilding Can we cache INUM’s plans more efficiently? Yes  But need internal access to the optimizer PINUM --> Call the optimizer just once!!

  7. Postgres Query Optimizer Query Preprocessor • Contains many INUM plans – but not all • plans to reduce search space • If a plan is pruned if it provides less interesting orders and costs more than another plan Subquery Planner Q a Grouping Planner Join Planner Index access costs Catalog Access Path Collector PINUM tunes the pruning algorithm to preserve maximum number of optimal plans

  8. PINUM Optimizer • No pruning at all • Search space large  slow dynamic program • Overhead of transferring the plans • Prune plans for same interesting orders • Set of returned plans is same as INUM • Prune if smaller interesting order set has lower query cost • Plan1 – requires IntOrd (A,B), Costs 100 • Plan2 – requires IntOrd (A), Costs 10

  9. Preliminary Experiments • PostgreSQL 8.3.7 • A synthetic star-schema workload • 10GB • 1 Fact table, 28 dimension tables • 10 queries with varying number of joins

  10. Experimental Results • An order of magnitude faster for plan cache construction • 5 times faster for index access cost construction • Reduces the INUM cache size by a factor of 6 • 2.7% loss in accuracy on average compared to direct optimizer call

  11. Conclusion • PINUM reduces the cache building time by a factor of 5 • By utilizing optimizer discarded plans • Enables physical designers on dynamic workloads • Part of a larger project on a physical designer for PostgreSQL • Please check out the demos at EDBT and SIGMOD

  12. Related Work • Configuration Parametric Optimization • Builds a “super plan” containing place holder for data accesses • Made for a top-down optimizer • INUM is a better fit for PostgreSQL’s intermediate plans • Requires minimal changes to the optimizer

  13. PostgreSQL Join Planner

More Related