To optimize SQL query performance in Ruby on Rails applications, it's essential to monitor and reduce the number of queries executed, especially to avoid unnecessary duplicates. Rails 7.2 introduced built-in query counting, allowing developers to identify excessive queries and refactor their code for better efficiency. Strategies like using SQL cache and memoization can help manage memory usage and streamline data access.