Re:Zero-downtime Postgres migrations – the hard parts
by spotman on Thursday May 28, 2015 @01:00AM
(#9616140)
Curious, is the:
SELECT DISTINCT(email) FROM parent;
The actual query you run in production, or similar enough? That could be a very expensive query with a very large amount of rows, even if indexed. (Large, being in the multi millions, depending on hardware). Might make more sense to run something like that on a reporting slave.
Re:Zero-downtime Postgres migrations – the hard parts
by Sinjo on Thursday May 28, 2015 @05:33AM
(#9616944)
That was a fabricated example, rather than something plucked from our codebase. It's the sort of query we avoid running on our production database.
I agree with your approach though. Our data analysis runs elsewhere.
Most of our queries are fast (tens of milliseconds or lower), which is how we got away without knowing about this for so long. Unsurprisingly, we've been making a bigger effort to eliminate any slow queries we do find lately. ;)