These are the queries I used to get the execution planer use the index scan
instead of the sequential scan:
IF NOT EXISTS (SELECT 1 FROM custom_data WHERE key = old.key) => sequential scan
IF NOT EXISTS (SELECT 1 FROM custom_data WHERE key = old.key LIMIT 1) =>
sequential scan
IF NOT EXISTS (SEL
Jeff Janes:
That is such a beautiful little trick. I made a table with just ids, and a
query for it reads almost 10 times less buffers (as reported by explain
analyze buffers), and sure enough, after another reboot, query executes
about 10 times faster.
I'm not doing anything special with those r