Link to home
Start Free TrialLog in
Avatar of solution46
solution46

asked on

WHERE IsNull([Field]) or WHERE [Field] Is Null?

OK folks,

bit of a techie question here. The question (and hence answer) will be of no practical value but I'm curious as to your thoughts. Incidentally, it was triggered by the question 'SQL Query Numeric Field Null Value' below...

Take a very simple query...

SELECT * FROM [Table] WHERE [Field] Is Null

Is this the quickest way of running it, or would WHERE IsNull([Field]) be quicker?

My personal thinking is that SQL runs within Access as a set of compiled functions, with the Is (as in Is Null) operator being a standard part. The function IsNull() must presumably be called from within whatever set of functions Access uses to process SQL, thereby making it (fractionally) slower. However, I am far from convinced that this is correct. To bump this up to the full 500 points, can anybody give me a detailed explanation of how Access processes SQL? i.e. are SELECT, INSERT and so on effectively pointers to built in functions; is there a whole layer of interpretation / optimisation to get through first or is there some other process entirely going on?

Just curious...

Cheers,

s46.
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Since "Is Null" is a native Jet operator whereas IsNull() is a VBA function, Is Null will always be faster as you don't have the overhead of passing the value through to the VBA engine.

SQL queries are processed by the Jet engine, not Access, which is essentially a shell. There are a bunch of optimisations that Access makes to the query path, and MS's patented (i.e. bought) Rushmore technology. Let me see if I can dig out an on-line reference for you. The Jet Programmer Guide would give you more information though.
Avatar of solution46
solution46

ASKER

Ahhh.. bloody obvious about IsNull() really.

By Access, I really meant Jet, as in the part that does the work! Where can I get hold of the Jet Programmer's Guide? Is that a M$ publication or third party?

s46.

ASKER CERTIFIED SOLUTION
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks - I'll see if I can find a copy lying round a bookshop.

The (hopefully 500) points are now yours.

s46.