Optimizing Your Reporting Queries with Bookings, Payments, and Line Items

Bookyt Team
May 18, 2026
1 min read
Bookyt

Optimizing Your Reporting Queries with Bookings, Payments, and Line Items

Your reporting queries with bookings, payments, and line items

Reporting queries with bookings, payments, and line items

In a reporting query that combines the Booking, Line Items, and Payments tables, the result set can increase when multiple payments exist for a single booking. This happens because of LEFT JOINs in SQL, which make it possible to link data from multiple tables.

Using bookings, payments, and line items in a reporting query

If a booking has two line items and two payments, each line item is linked with each payment, resulting in four records. To avoid this, you should use either the Payments table or the Line Items table in the query, but not both at the same time.

This approach reduces the result set and ensures more accurate data analysis.

Last updated on May 18, 2026