26 Jul '16, 12am

Reading a Postgres EXPLAIN ANALYZE Query Plan

The most powerful tool at our disposal for understanding and optimizing SQL queries is EXPLAIN ANALYZE , which is a Postgres command that accepts a statement such as SELECT ... , UPDATE ... , or DELETE ... , executes the statement, and instead of returning the data provides a query plan detailing what approach the planner took to executing the statement provided. Here’s a query pulled from the Postgres Using EXPLAIN page : EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=717.34..717.59 rows=101 width=488) (actual time=7.761..7.774 rows=100 loops=1) Sort Key: t1.fivethous Sort Method: quicksort Memory: 77kB -> Hash Join (cost=230.47..713.98 ...

Full article: https://robots.thoughtbot.com/reading-an-explain-analyze-...

Tweets

Need to earn #CEhours? Reading one @USGBC bimon...

usgbc.org 26 Jul '16, 4pm

Summer reading lists aren't just for schoolchildren. If you're looking for some extra credit, try adding USGBC+ to your li...

Here's your sustainability summer reading list

greenbiz.com 29 Jul '16, 9am

She identifies six factors for success: iconoclastic leadership fueled by deep conviction and a rebellious streak; disrupt...

Advanced Postgres Performance Tips

robots.thoughtbot.com 29 Jul '16, 12am

You’ve added the INDEX es , both partial and covering. You’ve VACCUUM ANALYZE d. You JOIN ed and INNER JOIN ed everything ...

"We [in London UK region] need a plan to tackle...

bettertransport.org.uk 28 Jul '16, 4pm

Commiserations to passengers who regularly catch Govia Thameslink's 7am Brighton to London service. Last year, this train ...