2 ms·
> It seems that's essentially what Postgres would do anyway. Yes, but if Postgres does it, it's literally impossible for the developer to screw up, whereas man
by majewsky 10y ago
> It seems that's essentially what Postgres would do anyway.
Yes, but if Postgres does it, it's literally impossible for the developer to screw up, whereas manually putting the ranking in the table can easily cause inconsistent records if you don't know what you're doing.
And even if you know what you're doing, next month's code change might not remember that it's important to update the ranking with the rest of the record (unless you're calculating it in a before_save hook or something).