Thanks for all the feedback... my colleague added an index to the second
table (the main table already had one) and this did wonders and brought the
query down to a split second. The query being the original SELECT... NOT IN
(SELECT ...)

Kevin


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of MB Software Solutions General Account
Sent: Wednesday, April 23, 2008 12:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Looking to optimize a query

Stephen Russell wrote:
> On Wed, Apr 23, 2008 at 9:25 AM, Kevin O'Shea <[EMAIL PROTECTED]>
> wrote:
> 
>> <snipped>
>> When building the lookup lists, we looked at using a
>> SELECT FROM maintable WHERE field1+field2+field3 NOT IN (SELECT
>> field1+field2+field3 FROM filterlisttable)
>><snipped>
> -------------------------------------
> 
> 
> are the keys the same between the tables?
> 
> SELECT FROM maintable
> WHERE pKey NOT IN
> (
> SELECT pKey  FROM filterlisttable
> )
> 
> 
> 

Steve -- isn't that what he already said in the original post right 
above what you wrote?!?!?!?!?????????????????????


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to