PostgreSQL: speed up a query with EXPLAIN and indexes
No reviews yet
Intermediate
2 h 15 min
1,000 credits
First lab free
Important
The cooperative's table holds a million rows: some queries take a second, that is the subject. The durations you see will not be exactly the guide's: compare the plans and the orders of magnitude. The validation checks that the million sales are still there: you speed a table up, you do not empty it. The sandbox lives for three hours.
Tip
In a plan, look for Index Cond: it is the index searching. A Seq Scan with a Filter on a big table, for a few rows, is an index that is missing or cannot be used. And remember that EXPLAIN ANALYZE really runs the query: in front of an UPDATE or a DELETE, always inside a transaction you roll back.
sql
performance
explain
index
full-text search
challenge
PostgreSQL: speed up a query with EXPLAIN and indexes · MonPremierLab