Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL SQL management 2009-2014 The following query is executing very slowly on a large amount of data. Would an Index help to speed it up?
SQL
SQL management 2009-2014
The following query is executing very slowly on a large amount of data.
Would an Index help to speed it up? If so, which columns should be indexed? Explain why an index can help but doesn't always.
SELECT c.cinema_name, s.price*SUM(t.ticket_id) AS 'total' FROM Cinema c INNER JOIN MovieSession s ON c.cinema_id = s.cinema_id INNER JOIN Ticket t ON t.ticket_id = s.ticket_id GROUP BY s.price, c.cinema_name HAVING SUM(t.ticket_id) > 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started