

Here’s my quick guide to fixing slow queries:
- grab your query.
- run
EXPLAIN ANALYZE <query> - If there’s a
Parallel Seq Scan, check theFiltervalue (which column are we checking) - you should likely try adding an index. - run
CREATE INDEX ON <table>(<column>); - run
EXPLAIN ANALYZE <query>again to check for improvements
Note that EXPLAIN <query> will only do a rough analysis, while EXPLAIN ANALYZE <query> will run your actual query, and analyse it.
If you want to ANALYSE EXPLAIN an INSERT query, do this:
BEGIN;
EXPLAIN ANALYZE INSERT ...;
ROLLBACK;
A simple ROLLBACK will help you here.
Rewriting the query will typically not do much - it might, but the chance it relatively small vs slapping an index on it.













I’m a programmer and have switched to NixOS, because I can define all my configurations in code+git repo, which is great. I now have a single repo that has some parts that are shared, and some parts are host-specific (one desktop + 2 laptops, for now), and if I fix some bug (like my Samsung 990 Pro SSDs having Linux issues), I know it’ll be permanently fixed, instead of having to re-figure everything out after a reinstallation.
NixOS BTW. We’re making it ours.
edit: Steam has been a non-issue, so gaming has been great so far! Not that I’ve been gaming a ton, but still.
Also, being able to use an LLM to fix stuff for me in my nixcfg repo has been great - I would NOT have been as productive with NixOS had I not have had Codex.