3 ms·
> Downside being that updates to amount are more costly PG always does a delete + create for updates. It will have no additional overhead at all
by VWWHFSfQ 2y ago
> Downside being that updates to amount are more costly
PG always does a delete + create for updates. It will have no additional overhead at all
- cwbriscoe 2y agoYou are updating both the data and the index when updating amount instead of just the data. That is twice the number of IO's.
- VWWHFSfQ 2y agoIt's the same IOs. PG does it regardless. Both the data and index
- Izkata 2y agoI believe they're confusing a single index with more columns vs adding additional indexes. Additional indexes would be slower to update. I suppose additional columns could be slower to update too (more data structure traversal), but I'm guessing not by nearly as much as an additional index.