If you have a query like this:
SELECT max(some_column) FROM mytable WHERE ...;
and you want to eliminate the sequence scan that kills the query's performance, an alternative is:
SELECT some_column FROM mytable WHERE ... ORDER BY some_column DESC LIMIT 1;
MIN and MAX aggregates can be eliminated this way.
aggregatesmaxminperformancepostgresqlqueriesscansql