The clause ('Assigned Person' != "Mark Brittain") will not use an index since 
it is a "not equal", so the only Index you could use is one on Status.  I was 
told (a long time ago) it is better to use <= instead of < (supposedly <= helps 
the database use an index).

Can you look and see when the last time that the index on Status was analyzed?

Fred

-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Brittain, Mark
Sent: Monday, March 14, 2011 1:49 PM
To: [email protected]
Subject: Re: Question about NULL

$NULL$

'Status' < "Closed" AND ('Assigned Person' != "Mark Brittain" OR 'Assigned 
Person' = $NULL$)

-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Elry
Sent: Monday, March 14, 2011 2:40 PM
To: [email protected]
Subject: Re: Question about NULL

Just a quick question Mark...

Did you mean $NULL$ OR NULL.


On Mar 14, 2:05 pm, "Brittain, Mark" <[email protected]> wrote:
> HI All,
>
> I have a table that uses the following query which searches for any open 
> record that is not assigned to me.
>
> 'Status' < "Closed" AND ('Assigned Person' != "Mark Brittain" OR 'Assigned 
> Person' = NULL)
>
> If I use the query without the Assigned Person' = NULL the result does not 
> include any records that are not assigned.  Both fields are indexed but the 
> NULL causes the full table scan. Is there a way  to write query so that 
> indexing is used but I get the records that are unassigned?
>
> Thanks
> Mark
>
> ____________________________________________
> Mark Brittain
> Remedy Developer
> NaviSite
> [email protected]<mailto:[email protected]>
> (315) 453-2912 x5335 (Office)
> (315) 317.2897 (Cell)

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug11 www.wwrug.com ARSList: "Where the Answers Are"

Reply via email to