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  

Query performance



 
 
Thread Tools Display Modes
  #1  
Old September 13th, 2005, 04:20 PM
TomHinkle
external usenet poster
 
Posts: n/a
Default Query performance

Can Anybody tell me what performs better in a where clause looking for
several text strings:

Method 1:
Like "Example_A" or like "Example_B"

Method 2:
In ("Example_A","Example_B")
  #2  
Old September 13th, 2005, 07:20 PM
MGFoster
external usenet poster
 
Posts: n/a
Default

TomHinkle wrote:
Can Anybody tell me what performs better in a where clause looking for
several text strings:

Method 1:
Like "Example_A" or like "Example_B"

Method 2:
In ("Example_A","Example_B")


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Those examples mean different things. If Method 1 was like this

column_name = "Example_A" or column_name = "Example_B"

then it would be the same as method 2. Since you don't have any
wildcard characters in your example you should be using the equal sign
instead of the Like comparison operator.

When using the equal sign in method 1 they both perform the same. The
JET optimizer translates method 2 into method 1 when the query runs.
--
MGFoster:::mgf00 at earthlink decimal-point net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQycYbIechKqOuFEgEQJtcQCgwqtgURROBQb3o3WOGKMC0l I1b/MAoIj8
yjgTEmTewUbaRM265T4DqvYI
=dMQz
-----END PGP SIGNATURE-----
  #3  
Old September 14th, 2005, 04:51 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default

Please do not multipost the same question in these newsgroup.

Please see The Access Web http://www.mvps.org/access/netiquette.htm

--
HTH
Van T. Dinh
MVP (Access)



"TomHinkle" wrote in message
...
Can Anybody tell me what performs better in a where clause looking for
several text strings:

Method 1:
Like "Example_A" or like "Example_B"

Method 2:
In ("Example_A","Example_B")



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when running Query, but not Report Blaze Running & Setting Up Queries 29 September 9th, 2005 05:40 AM
Moving from xBase/Clipper [email protected] New Users 1 February 3rd, 2005 08:25 PM
adding 2 fields including null entries Jesse Running & Setting Up Queries 26 January 18th, 2005 06:31 PM
Query performance Hermione Running & Setting Up Queries 0 January 12th, 2005 05:01 PM
Compare performance between Sub Query and SQL subquery Malee Running & Setting Up Queries 1 October 12th, 2004 11:31 AM


All times are GMT +1. The time now is 04:26 PM.


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