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

bookChallenge: Diagnosing a Slow Payment Query

Aufgabe

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ösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Diagnosing a Slow Payment Query

Swipe um das Menü anzuzeigen

Aufgabe

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ösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 4
single

single

some-alt