Challenge: Diagnosing a Slow Payment Query
Tehtävä
Swipe to start coding
You are asked to diagnose and optimize a slow query that retrieves payment records for paid rides, joining the payments and riders tables. Use the EXPLAIN output to identify the bottleneck and optimize the query for better performance.
- Analyze the query using EXPLAIN to observe the current execution plan.
- Identify the cause of the slow performance, focusing on sequential scans or inefficient joins.
- Add an index to the
paymentstable to improve filtering and ordering bystatusandpayment_time. - Verify the optimization by running EXPLAIN on the query again.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 4
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 4.76
Challenge: Diagnosing a Slow Payment Query
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
You are asked to diagnose and optimize a slow query that retrieves payment records for paid rides, joining the payments and riders tables. Use the EXPLAIN output to identify the bottleneck and optimize the query for better performance.
- Analyze the query using EXPLAIN to observe the current execution plan.
- Identify the cause of the slow performance, focusing on sequential scans or inefficient joins.
- Add an index to the
paymentstable to improve filtering and ordering bystatusandpayment_time. - Verify the optimization by running EXPLAIN on the query again.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 4
single