A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Optimization of Between Clause Queries



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 4th, 2010, 11:42 PM posted to microsoft.public.access.queries
Kevin Myers
external usenet poster
 
Posts: 1
Default Optimization of Between Clause Queries

I have some sql queries involving the use of between clauses, similar to the
following:

select Colors1.*, sum(Colors2.freq) as TFreq
from OldColors as Colors1, OldColors as Colors2
where Colors2.r between Colors1.r - 7 and Colors1.r + 7
and Colors2.g between Colors1.g - 7 and Colors1.g + 7
and Colors2.b between Colors1.b - 7 and Colors1.b + 7
group by Colors1.r, Colors1.g, Colors1.b;

The OldColors table has several indexes, including one that is defined as
follows:
create index RGB on OldColors(r, g, b);

Can anyone tell me with a high degree of certainty whether the jet 4.0
database engine can optimize the above query based on this index?
Does jet 4.0 *ever* optimize queries with WHERE clauses that only consist of
BETWEEN clauses?

Thanks,
KM



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.