flâneur — a map of the web's best reading

Postgresql tricks | Lanre Adelowo

lanre.wtf · 2,014 words · saved by 1 readers

I was recently caught up in a Twitter thread where someone suggested using a materialized view for calculating some value from another table. I suggested using a TRIGGER instead as it happens in the same transaction. Someone DM'd me saying it solved a problem he has been having at work with poor performance while they are trying to update another table as they were doing it via code, fetching all data, then iterating to calcualate the difference. Asides that, it meant the table was out of sync when they get concurrent requests. I then decided to list some of my favorite and useful postgresql features. Might find them useful. Might not :) but here is a tiny list: weird bug, links to sections do not work, so you might need to scroll. Currently fixing as soon as i can find time. apologies :))) please don't do this in production lmao so as not to make people start thinking silly data is still stored. I really hope you hate nulls as much as I do. But sometimes we just need to keep them arou

back May 11, 2023 Postgresql tricks 10 min read Tags database I was recently caught up in a Twitter thread where someone suggested using a materialized view for calculating some value from another table. I suggested using a TRIGGER instead as it happens in the same transaction. Someone DM'd me saying it solved a problem he has been having at work with poor performance while they are trying to update another table as they were doing it via code, fetching all data, then iterating to calcualate the difference. Asides that, it meant the table was out of sync when they get concurrent requests. I th

Explore this link on the map →

related reading