I have a large SQL database table - in excess of 8923411 rows.
I am trying to run the following SQL statement.
SELECT Display_Name, Product_ID, Version,COUNT(*) as Number
GROUP BY Display_Name, Product_ID, Version
ORDER BY Number Desc
On this table there are the following indexes I have created:
CREATE INDEX IX_Machine_Name ON VP.dbo.vp_machine_inventory_list (Machine_Name)
CREATE INDEX IX_Display_Name ON VP.dbo.vp_machine_inventory_list (Display_Name)
CREATE INDEX IX_Product_ID ON VP.dbo.vp_machine_inventory_list (Product_ID)
CREATE INDEX IX_Publisher ON VP.dbo.vp_machine_inventory_list (Publisher)
CREATE INDEX IX_Version ON VP.dbo.vp_machine_inventory_list (Version)
I created these indexes to try to speed up the query however it still takes 3 mins / 7 seconds to run
and return back 14,329 rows.
Now given the indexes I created I was expecting the query to run a lot faster then this?
Is there something I have missed here? I was hoping the way I designed the indexes would bump up the execution speed.
What I am missing here?
Also would these indexes be used if I am making an ODBC connection to the database - and using MS Access to do the same select statement?