Indexes, Query Optimization
PDBM 7.5, 12.3.5
- Dr. Chris Mayfield
Indexes, Query Optimization PDBM 7.5, 12.3.5 Dr. Chris Mayfield - - PowerPoint PPT Presentation
Indexes, Query Optimization PDBM 7.5, 12.3.5 Dr. Chris Mayfield Department of Computer Science James Madison University Feb 18, 2020 Part 1: SQL Indexes How data is stored Heap File Index File (table: movie ) (column: movie.year ) RID id
Feb 18, 2020 Indexes, Query Optimization 3 of 18
Feb 18, 2020 Indexes, Query Optimization 4 of 18
Feb 18, 2020 Indexes, Query Optimization 5 of 18
Feb 18, 2020 Indexes, Query Optimization 6 of 18
Feb 18, 2020 Indexes, Query Optimization 8 of 18
16 18 20 22 24 26 28 30 32 34 0.00 0.04 0.08 0.12 0.16
Feb 18, 2020 Indexes, Query Optimization 9 of 18
◮ [Plan A] when 90% have a = 1 ◮ [Plan B] when a = 1..10000, 1 time each ◮ [Plan C] when a = 1..10, 1000 times each
Feb 18, 2020 Indexes, Query Optimization 10 of 18
Feb 18, 2020 Indexes, Query Optimization 11 of 18
Feb 18, 2020 Indexes, Query Optimization 12 of 18
Feb 18, 2020 Indexes, Query Optimization 13 of 18
Feb 18, 2020 Indexes, Query Optimization 14 of 18
Feb 18, 2020 Indexes, Query Optimization 15 of 18
Feb 18, 2020 Indexes, Query Optimization 16 of 18
Feb 18, 2020 Indexes, Query Optimization 17 of 18
Feb 18, 2020 Indexes, Query Optimization 18 of 18