I am getting performance issue when i run the following query. Its taking 5 to 8 min to provide the data.
City table contains 45000 records.
State table contains 500 records
Country table contains 300 records
Now the Query as follows......
F.fileid as 'Fileid',
F.FileName as 'File Name',
D.Zip as 'Zip',
D.City as 'City',
D.State as 'State',
D.Country as 'Country',
D.AddressTypeID as 'AddressTypeID'
lap_file F ,lap_filedatarecord L, lap_datarecord_address D
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)));