In the midst of increasingly fierce competition in the retail business, companies need to implement effective promotional strategies to boost sales and attract customer interest in the various products they offer. Jaffamart, as a provider of daily necessities, possesses valuable transaction data with great potential to be developed into a product recommendation system. This study aims to build a product recommendation system based on purchase frequency while analyzing the comparative effectiveness of two types of SQL queries, namely Cartesian Product and JOIN, in the process of retrieving recommendation data after being optimized using heuristic techniques. The methods applied include transaction data analysis over a specific period, database design, implementation of SQL queries with two different methods, and the application of heuristic techniques to filter relevant data and improve query execution speed. The research findings indicate that the JOIN query consistently delivers faster and more efficient execution times compared to Cartesian Product, especially when handling large volumes of data. Furthermore, the product recommendation results over a 2-month period identified products with the highest purchase frequencies, such as Energen Sereal Cokelat 29gr, Kapal Api Mix, and Susu Jahe Sidomuncul, which are suitable to be prioritized in promotional programs. The implementation of heuristic techniques has proven effective in enhancing query performance and generating more accurate and relevant product recommendations in accordance with current conditions. These findings contribute to the development of recommendation systems and efficient transaction data management strategies for the retail business sector.