| | 292 | |
| | 293 | ==== Со индекс: |
| | 294 | |
| | 295 | {{{ |
| | 296 | |
| | 297 | -- index for linking ticket purchases to the specific tickets |
| | 298 | CREATE INDEX idx_ticket_purchase_ticket_id ON "Ticket_Purchase"(ticket_id); |
| | 299 | |
| | 300 | -- index for the LEFT JOIN with refunds to calculate net revenue accurately |
| | 301 | CREATE INDEX idx_ticket_refund_purchase_id ON "Ticket_Refund"(purchase_id); |
| | 302 | |
| | 303 | -- index for linking tickets to scheduled events |
| | 304 | CREATE INDEX idx_ticket_event_happening_id ON "Ticket"(event_happening_id); |
| | 305 | |
| | 306 | |
| | 307 | EXPLAIN ANALYZE |
| | 308 | SELECT * |
| | 309 | FROM "Event_Financial_Summary"; |
| | 310 | |
| | 311 | }}} |