You have a PostgreSQL table with 50 million rows and a query running in 8 seconds. Walk me through the optimization.

Technical