471,596 Members | 1,224 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

What is quicker as Select?

I read somewhere that to gain efficiency it is advisable to avoid the
use of select. But they don't explain why or what to use instead. Is it
true? I habe a problem of speed (better to say of NO SPEED) but I don't
know if it has something to do with the use of select.
Waht can I use instead?

Jul 21 '05 #1
2 1577
be*****@coaster.ch wrote:
I read somewhere that to gain efficiency it is advisable to avoid the
use of select. But they don't explain why or what to use instead. Is it
true? I habe a problem of speed (better to say of NO SPEED) but I don't
know if it has something to do with the use of select.
Waht can I use instead?


Hi,

Not sure, but maybe you misunderstood, and confused the above with SELECT *
and SELECT column1, column2.

SELECT * FROM tblusers;

is slower than

SELECT userid, username FROM tblusers;

So naming the columns is faster than using *, even if you select all
columns.
Reason is that the database has to retrieve the real columnnames first and
replace * with it, before executing the query.

Don't expect huge benefits though.

Besides that: If you use * instead of naming the columns, and the columns
you need are just a small subset of all columns, the naming of columns
clearly will be lot faster because the database has to deliver less data.

Regards,
Erwin Moller
Jul 21 '05 #2
be*****@coaster.ch wrote:
I read somewhere that to gain efficiency it is advisable to avoid the
use of select. But they don't explain why or what to use instead. Is it
true? I habe a problem of speed (better to say of NO SPEED) but I don't
know if it has something to do with the use of select.
Waht can I use instead?

Bettina,

I assume you are talking about using SELECT * vs SELECT
<column-name-list>. If that is so the correct answer is that it
doesn't make any significant difference. Most of the time in
database operations is spent accessing and reading data from the
disk drives -- not processing the data once it has been read.
(The difference is something like ten to one.)

The vast majority of the complaints about database performance
being too slow are the result of not having indexes, not using
the indexes that do exist, and failing to run the RDBMS admin
programs that analyze the data and update the index usage strategy.

HTH
Jerry
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Chris Mantoulidis | last post: by
8 posts views Thread by WindAndWaves | last post: by
2 posts views Thread by Justin Koivisto | last post: by
7 posts views Thread by adam | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.