A dumbveloper at my work (years ago) moved the body
column from our comments
table to a secondary comment_extensions
table as some sort of sketchy guesswork optimization. It seems ill-advised to do a join every time we want to display a comment, so I'm going to try moving that column back into our comments
table and run some benchmarks.
My problem is that this update crawls. I let it run for an hour before shutting it off, fearing that it would take all night.
UPDATE comments SET body = comment_extensions.body
FROM comment_extensions
WHERE comments.id = comment_extensions.comment_id;
It's a PostgreSQL 8.1 database, and comment_extensions.comment_id
is indexed.
Any suggestions for making this run faster?