Can you explain how you optimized SQL queries for datasets exceeding 100 million records, and what results were achieved?

Technical