Hello, I am changing from MS-SQL/ASP to MySQL/PHP a search engine and I have problems with SQL statements:
In MSSQL I have queries like this:
SELECT Categorie.ID_Categ, Categorie.DescrCateg FROM Categorie INNER JOIN (CommercioCategorie INNER JOIN CommercioLocalita ON CommercioCategorie.ID_Comm=CommercioLocalita.ID_Comm) ON Categorie.ID_Categ = CommercioCategorie.ID_Categ
WHERE CommercioLocalita.ID_Frazione=1001
I try to write this using JOIN condition but also changing JOINS into WHERE conditions:
SELECT Categorie.ID_Categ, Categorie.DescrCateg FROM Categorie, CommercioCategorie, CommercioLocalita WHERE
Categorie.ID_Categ=CommercioCategorie.ID_Categ AND CommercioCategorie.ID_Categ=CommercioLocalita.ID_Categ
AND CommercioLocalita.ID_Frazione=1001
All tables are indexed and all fields joined are keys used to link tables in two examples posted here, but queries are too slow... for a search engine about 15 seconds with 60,000 records means very slow :-((
In MSSQL I have queries like this:
SELECT Categorie.ID_Categ, Categorie.DescrCateg FROM Categorie INNER JOIN (CommercioCategorie INNER JOIN CommercioLocalita ON CommercioCategorie.ID_Comm=CommercioLocalita.ID_Comm) ON Categorie.ID_Categ = CommercioCategorie.ID_Categ
WHERE CommercioLocalita.ID_Frazione=1001
I try to write this using JOIN condition but also changing JOINS into WHERE conditions:
SELECT Categorie.ID_Categ, Categorie.DescrCateg FROM Categorie, CommercioCategorie, CommercioLocalita WHERE
Categorie.ID_Categ=CommercioCategorie.ID_Categ AND CommercioCategorie.ID_Categ=CommercioLocalita.ID_Categ
AND CommercioLocalita.ID_Frazione=1001
All tables are indexed and all fields joined are keys used to link tables in two examples posted here, but queries are too slow... for a search engine about 15 seconds with 60,000 records means very slow :-((