Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 10 of 11 total |
Slow with OR TEXTSEARCH |
Fri, Feb 24 2006 9:28 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
Why if I have the OR'd TEXTSEARCH does this query take ages (128 secs but with only one of the TEXTSEARCH's its fast (.11sec for altbert and 1.27sec for presentations)? Running V4.22b5 SELECT _MsgNo, _BoxNo, _fkCompanies, _fkContacts, _InOutInd,IF(_Attachments IS NOT NULL THEN TRUE ELSE FALSE) AS _xAttachmentsExist,IF(_Additional IS NULL THEN _Subject ELSE _Subject + '[' +_Additional + ']') AS _xDisplay,_TimeStamp, _Consultant,_Format,IF(_WhoFrom IS NOT NULL THEN _WhoFrom ELSE _WhoTo) As _xWho INTO Memory\Search2231158 FROM MandN T0 WHERE TEXTSEARCH ('albert' IN T0._Message) OR TEXTSEARCH ('presentations' IN T0._Message) AND (T0._BoxNo >= -11 OR CAST(T0._BoxNo / -100000 AS INTEGER) = 4) Roy Lambert |
Fri, Feb 24 2006 10:02 AM | Permanent Link |
Michael Baytalsky | Are you sure you got the logic right? I'd put both ORs inside parenthesis, otherwise it may be that the second one is evaluated with AND first A or B and C => A or (B and C) In this case A condition will not be sufficient to prevent full table scan if C cannot be optimized by indexes (IMO, your CAST prevents this). Try executing without C and try with parenthesis as above. Michael Roy Lambert wrote: > Tim > > Why if I have the OR'd TEXTSEARCH does this query take ages (128 secs but > with only one of the TEXTSEARCH's its fast (.11sec for altbert and 1.27sec for presentations)? > > Running V4.22b5 > > SELECT _MsgNo, _BoxNo, _fkCompanies, _fkContacts, _InOutInd,IF(_Attachments IS NOT NULL THEN TRUE ELSE FALSE) AS _xAttachmentsExist,IF(_Additional IS NULL THEN _Subject ELSE _Subject + '[' +_Additional + ']') AS _xDisplay,_TimeStamp, _Consultant,_Format,IF(_WhoFrom IS NOT NULL THEN _WhoFrom ELSE _WhoTo) As _xWho INTO Memory\Search2231158 > FROM MandN T0 > WHERE > TEXTSEARCH ('albert' IN T0._Message) OR > TEXTSEARCH ('presentations' IN T0._Message) > > AND > (T0._BoxNo >= -11 > OR > CAST(T0._BoxNo / -100000 AS INTEGER) = 4) > > Roy Lambert |
Fri, Feb 24 2006 10:04 AM | Permanent Link |
Michael Baytalsky | > .... and try with parenthesis as above. What I meant is (A or B) and C - is not what I said . Michael > > Michael > > > Roy Lambert wrote: >> Tim >> >> Why if I have the OR'd TEXTSEARCH does this query take ages (128 secs but >> with > only one of the TEXTSEARCH's its fast (.11sec for altbert and 1.27sec for > presentations)? >> >> Running V4.22b5 >> >> SELECT _MsgNo, _BoxNo, _fkCompanies, _fkContacts, >> _InOutInd,IF(_Attachments IS NOT NULL THEN TRUE ELSE FALSE) AS >> _xAttachmentsExist,IF(_Additional IS NULL THEN _Subject ELSE _Subject >> + '[' +_Additional + ']') AS _xDisplay,_TimeStamp, >> _Consultant,_Format,IF(_WhoFrom IS NOT NULL THEN _WhoFrom ELSE _WhoTo) >> As _xWho INTO Memory\Search2231158 >> FROM MandN T0 >> WHERE >> TEXTSEARCH ('albert' IN T0._Message) OR >> TEXTSEARCH ('presentations' IN T0._Message) >> >> AND >> (T0._BoxNo >= -11 >> OR >> CAST(T0._BoxNo / -100000 AS INTEGER) = 4) >> >> Roy Lambert |
Fri, Feb 24 2006 10:27 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
Dead right - stupid sql parser - you'd think it would know what I meant Thanks Roy Lambert |
Fri, Feb 24 2006 1:37 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< Dead right - stupid sql parser - you'd think it would know what I meant >> I told you guys it was dumb compared to a human, but you didn't believe me. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Feb 24 2006 2:16 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
Which human are you comparing it to - I know some who would get it even more wrong (me for instance)! Roy Lambert |
Fri, Feb 24 2006 7:10 PM | Permanent Link |
Michael Baytalsky | +1.
Roy Lambert wrote: > Tim > > > Which human are you comparing it to - I know some who would get it even more wrong (me for instance)! > > > Roy Lambert > |
Sat, Feb 25 2006 3:25 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Michael
Sometimes I have difficulty following your posts because they are to technical for my simple brain. This one for instance ..... Roy Lambert |
Sat, Feb 25 2006 7:52 AM | Permanent Link |
"Ralf Mimoun" | Roy Lambert wrote:
> Michael > > > Sometimes I have difficulty following your posts because they are to > technical for my simple brain. This one for instance ..... I think he means "Inc(human_who_would_get_it_even_more_wrong)". Which I want to execute, too. Ralf |
Sat, Feb 25 2006 9:32 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ralf
Got it - thanks Roy Lambert |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |