Simple clear advice in plain English

Hands on: Understanding SQL queries

Discover how SQL queries are executed and decide whether to upgrade to SQL Server

This illustrates the beauty of declarative languages such as SQL, because most writers of queries will not know such details as table sizes and how they’re indexed, or indeed how to make best use of this knowledge. Happily all that can be ignored as the query optimiser works out the plan for you.

The bad news is that all this takes time. For a query built and used within Access, the optimiser will work out an execution plan every time the query is run.
However, suppose your data is held in SQL Server and you’re querying from an Access client application.

If you store your query locally in Access then, when you run it, Access doesn’t do the optimisation. It sends the query to SQL Server. When it arrives, the optimiser in SQL Server will work out an execution plan and, again, it has to do this every time the query is run.

However, you can also choose to store the query as a ‘View’ on the server. In this case, the execution plan is built the first time the view is run and thereafter is stored in the database along with the SQL string.

When the view is run again, it uses the saved execution plan, pulls together the most up-to-date set of data and presents the answer. The bottom line is that in a client-server environment, views will often run faster than queries from the client application. The improvement in performance can be significant, especially when the SQL becomes more complex.

Upsizing your engine
In response to the recent reader poll, I started discussions about moving upwards from Access to SQL Server. I’ll continue with a little scene setting and then descend into more detail about some of the differences you’ll encounter should you decide to play the SQL Server game.

As I said last time, the best place to start is SQL Server Express, mainly because it’s free. As with most Express/Lite/Junior editions, there are limitations to what you can build, and Express also imposes hardware restrictions. Express will only address one physical CPU and a maximum of 1GB of Ram; it will run on machines with higher specifications, but ignores any additional CPUs or memory.

The maximum size a database can reach is 4GB. However, anything you build can be upgraded to the Enterprise edition if it becomes necessary. It is also OK to build stuff commercially: “there are no licensing restrictions for applications built using the Express Editions”, according to the Microsoft FAQ.

Article tags

Reader Comments

dot net problem

Unfortunatly if you have updated beyond .net version 2 you can't use SQL 2005

Posted by Bob Veitch, 06 Jan 2009

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

dia-portable

Make professional looking diagrams with Dia Portable

The portable version of this open source diagram software

Keep your PC up to date illustration

How healthy is your PC?

Do you think your PC's performance is lacking a certain something? We show you how to get your computer working to the best of its ability

Microsoft Word list screenshot

Improve the appearance of lists within lists in Word 2003

Whether you are writing a recipe or a complicated reference book, it is possible to create manageable lists and sub-sections to improve their appearance

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£359.98- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive