Whenever you're ready, walk me through how you'd approach this.
Explain how you would optimize a query that is running slowly due to large table joins on streaming history data at Tubi.
Discuss how you would diagnose the bottleneck, reduce unnecessary work, improve join and filter performance, and validate that the revised query is faster without changing its results. Address relevant PostgreSQL tools, indexing, data volume, and execution-plan considerations.