Speeding up a query

Henley12

Troy University Fan
Local time
Today, 12:58
Joined
Oct 10, 2007
Messages
222
I have a huge table that I am trying to query for a date range. Is it faster to do a select on just the fields I need as opposed to a SELECT * FROM (tblname)?
 
Nope dont matter... * or specific fields (if your in an access database)

make sure your using real dates and/or that the date fields are indexed
 
The date fields are indexed, however they are down on the list of indexed fields. Somewhere in the 5 or 6 range. That would make quite a difference, wouldn't it?
 
Actually, it CAN make a difference in pulling ONLY the fields you want instead of *.
 
Bob, if you are INSIDE an access database?

Doing * can offcourse make a difference in particular if the data is beeing draged over a (slow?) intranet/network, more data> More time

Also any optimizer will have to look at what columns there actually are, but that should <on average> take about 0.0001 seconds
 
This is not an Access database. I believe it is an Oracle database.
 
Bob, if you are INSIDE an access database?

Doing * can offcourse make a difference in particular if the data is beeing draged over a (slow?) intranet/network, more data> More time

Also any optimizer will have to look at what columns there actually are, but that should <on average> take about 0.0001 seconds
Never ask SQL Server (or Oracle) to send you more data than you need. Take advantage of it's abilities and do not rely on Access to narrow things down especially if you were to say have 100 people working with this Access database and all were hitting the SQL Server (or Oracle) for * on the tables. It makes no sense and your network admins are going to get pissed.
 

Users who are viewing this thread

Back
Top Bottom