============================================================ PART A: INDEXING EXERCISES ============================================================ Exercise 1: Analyze Query Performance (Easy) Task: Compare query performance with and without index on the film table. Requirements: - Use EXPLAIN to analyze: SELECT * FROM film WHERE title = 'ACADEMY DINOSAUR' - Note the number of rows scanned - Create an index on title column - Run EXPLAIN again and compare results ============================================================ Exercise 2: Create Indexes for Common Queries (Medium) Task: Identify and create appropriate indexes based on query patterns. Requirements: - Analyze these common queries and create optimal indexes: ============================================================ Exercise 3: Composite Index Order (Medium) Task: Understand how composite index column order affects query performance. Requirements: - Create a composite index on film(rating, rental_duration) - Test these queries and explain which ones can use the index: WHERE rating = 'PG' WHERE rental_duration = 5 WHERE rating = 'PG' AND rental_duration = 5 ============================================================ Exercise 4: FULLTEXT Index (Medium) Task: Create a fulltext search for film descriptions. Requirements: - Create a FULLTEXT index on film.description - Search for films containing specific keywords - Compare with LIKE search ============================================================ PART B: PARTITIONING EXERCISES ============================================================ Note: Sakila database is small, so partitioning isn't necessary for it. But for learning purposes, we'll create a demo table with more data. ============================================================ Exercise 5: Create RANGE Partition Table (Medium) Task: Create a partitioned version of the rental table by year. Requirements: - Create a new table rental_partitioned with RANGE partitioning by rental_date - Copy data from original rental table - Compare query performance ============================================================ Exercise 6: LIST Partition by Store (Medium) Task: Create a partitioned customer table by store. Requirements: - Create customer_partitioned with LIST partitioning by store_id - Insert data from original table - Query specific partition