Performace Check | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Performace Check

Hi, I have written the following query in MySQL, its taking lot of time to retrieve the values. Please provide me the solution. The Table "lap_City" Contains 50 thousand records, "lap_state" contains the 40 thousand records. SELECT Distinct
,F.fileid,
,F.FileName
,D.Zip
,D.City
,D.State
,D.Country
FROM
lap_file F ,
lap_filedatarecord L,
lap_datarecord_address D
WHERE F.fileid=L.fileid
AND L.filedatarecordid=D.filedatarecordid
AND F.batchid=66
AND D.addresstypeid=3
AND (d.zip NOT IN(SELECT zip FROM lap_City lc where lc.cityname=d.city and lc.stateid
IN(select stateid from lap_state ls where ls.statecode=d.state)));
Thank You With Regards
Aruna Mathew
Sorry, but if you have really written this in MySQL’s SQL dialect, you should ask your question in a MySQL dedicated community, such as the MySQL mailing lists orhttp://www.dbforums.com
Frank Kalis
Moderator
Microsoft SQL Server MVP
Webmaster:http://www.insidesql.de
]]>