Hi
I bet slow queries are quite a common problem but i am not too sure what is causing mine to be so slow. It takes at least 55 seconds to run at the moment.
I have narrowed the problem down to the from clause by simplifying the select part of the sql statement. Although the example pasted below has a very simple select part, all of the tables are needed for the query to run properly.
<code>
SELECT tblCollection.HireID
FROM ((tblTariff INNER JOIN (tblProductions INNER JOIN (tblEquipment INNER JOIN (tblCollection INNER JOIN tblCollectionItemized ON tblCollection.HireID = tblCollectionItemized.HireID) ON tblEquipment.KitKey = tblCollectionItemized.KitKey) ON tblProductions.ProductionIDKey = tblCollection.ProductionName) ON tblTariff.TariffKey = tblCollection.Tarriff) INNER JOIN tblRateCard ON tblTariff.TariffKey = tblRateCard.Tariff) INNER JOIN tblKitSubCat ON (tblKitSubCat.CategoryID = tblEquipment.KitSubCategory) AND (tblRateCard.KitKey = tblKitSubCat.CategoryID)
WHERE HireID=1234
</code>
and I have attached a graphical form of the query.
Thanks in advance for any help you can offer.
Jon
I bet slow queries are quite a common problem but i am not too sure what is causing mine to be so slow. It takes at least 55 seconds to run at the moment.
I have narrowed the problem down to the from clause by simplifying the select part of the sql statement. Although the example pasted below has a very simple select part, all of the tables are needed for the query to run properly.
<code>
SELECT tblCollection.HireID
FROM ((tblTariff INNER JOIN (tblProductions INNER JOIN (tblEquipment INNER JOIN (tblCollection INNER JOIN tblCollectionItemized ON tblCollection.HireID = tblCollectionItemized.HireID) ON tblEquipment.KitKey = tblCollectionItemized.KitKey) ON tblProductions.ProductionIDKey = tblCollection.ProductionName) ON tblTariff.TariffKey = tblCollection.Tarriff) INNER JOIN tblRateCard ON tblTariff.TariffKey = tblRateCard.Tariff) INNER JOIN tblKitSubCat ON (tblKitSubCat.CategoryID = tblEquipment.KitSubCategory) AND (tblRateCard.KitKey = tblKitSubCat.CategoryID)
WHERE HireID=1234
</code>
and I have attached a graphical form of the query.
Thanks in advance for any help you can offer.
Jon