DEV Community

Cover image for Improving PostgreSQL queries

Improving PostgreSQL queries

Michiel Hendriks on April 30, 2019

A while ago I commented that my big win was improving a query which took over an hour to execute to just 30 seconds. In fact, for the client this q...
Collapse
 
andreasneuman profile image
andreasneuman

Great article, thanks!
I want to share my experience too, hope it can be useful for somebody.
I'd like to add one more tool for query improvement - Query Profiler in dbForge Studio for PostgreSQL. This visual analyzer helps me a lot and is easy to use.

Collapse
 
ghost profile image
Ghost

Great article, too often we get trapped in discussions about which JS framework give us a +2% speed bump or which sorcery gives some extra juice of our servers, and this is what usually have the bigger impact and all it cost is extra care of out old good pal SQL.

In my last Django project after a "cleanup", just polishing some queries I made some awful request take 10 even 100 times less time. I can't think in another drastic performance influence in just 1 LOC.

PS: For those working with Django github.com/jazzband/django-debug-t...

Collapse
 
rhymes profile image
rhymes

Great writeup Michiel, thanks! So many tips!

Collapse
 
doribd profile image
Dor Ben Dov

thanks for sharing, very interesting summary.

Collapse
 
asdrubalivan profile image
Asdrúbal Iván 🇻🇪

This is great! Thank you for sharing!!

Collapse
 
annarankin profile image
Anna Rankin

This is super! Fantastic advice; I had no idea about all the flexibility you can get out of indexes.