Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Diagnosing a Slow Payment Query | Real-World Query Optimization Scenarios
Mastering SQL EXPLAIN and Query Planning

bookChallenge: Diagnosing a Slow Payment Query

Uppgift

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 payments table to improve filtering and ordering by status and payment_time.
  • Verify the optimization by running EXPLAIN on the query again.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 4
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

close

bookChallenge: Diagnosing a Slow Payment Query

Svep för att visa menyn

Uppgift

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 payments table to improve filtering and ordering by status and payment_time.
  • Verify the optimization by running EXPLAIN on the query again.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 4
single

single

some-alt