SQL process taking forever

Results 1 to 2 of 2

Thread: SQL process taking forever

  1. #1
    Join Date
    Dec 1969

    Default SQL process taking forever

    Have this view:<BR>SELECT DISTINCT <BR> tblAgents.AgentNumber, tblAgents.FName, tblAgents.LName, <BR> tblAgents.address, tblAgents.city, tblAgents.state, <BR> tblAgents.zip, tblAgents.phone, tblAgents.email, <BR> tblAgents.AgentPhoto, tblOffices.Realtor, <BR> tblAgents.officenumber<BR>FROM tblAgents INNER JOIN<BR> tblOffices ON tblAgents.officenumber = tblOffices.OfficeNumber<BR><BR>I add soem queries to it, and union them together (union 3 different types of searches, based on values in another table) the process times out on the server, doesn&#039;t even return a recordset.<BR><BR>Any ideas on how to speed it up a bit? I&#039;ve added keywords to the tables involved, to include the fields that are being selected, but the process still takes forever and a day.<BR><BR>Any ideas?<BR><BR>Thanks,<BR>-- Ben

  2. #2
    Join Date
    Dec 1969

    Default Do the separate processes...

    ...the 3 queries you are UNIONing...each take a long time? Or does one of them take much longer than the others?<BR><BR>I presume you mean you "added indexes" and not "added keywords"?<BR><BR>If so, then "...to include the fields that are being selected..."<BR><BR>That won&#039;t help the SELECT process. Only fields that participate in the JOIN or in WHERE clauses need to be indexed.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts