473,390 Members | 1,339 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 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 1640
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NotGiven | last post by:
I am researching the best place to put pictures. I have heard form both sides and I'd like to know why one is better than the other. Many thanks!
5
by: MaJoHu | last post by:
I've got a list where u can select some products. It's something like this: <SELECT NAME='Product' MULTIPLE SIZE='10'> <% 'Get every possible item from items table SQL = "SELECT DISTINCT...
13
by: Chris Mantoulidis | last post by:
There must be some tips to make a program quicker. I guess more than 50% of ppl here will say "avoid the if-s". Yeah I know this makes a program quicker but some times an "if" is inevitable,...
1
by: MLH | last post by:
I asked mysql to create a database named credifree (see below) and later checked for filenames on the system like *credifree* but I found nothing indicating that mysql created any filenames like...
6
by: John | last post by:
Just a general question... I'm currently using a combobox that when updated, opens a form with its recordset based on a query using the combo box value as the criteria. I'm I correct in...
8
by: WindAndWaves | last post by:
Hi Gurus I have a query that contains reference to the following function: Public Function UserStatus() As Byte Const ProEro = 1: 'on error GoTo ERR '--- UserStatus = Nz(DLookup("", "", "!="...
2
by: Justin Koivisto | last post by:
In PHP, I do the following (pseudo code for clarity)... Query: SELECT distinct(web_contacts.zip) FROM web_contacts WHERE web_contacts.zip <> '' Query: SELECT DISTINCT(contacts.zip) FROM contacts...
5
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique...
7
by: adam | last post by:
I'm currently coding a CMS system for a site which includes the feature to create multiple sections inside a page. To add each of these new sections I'm using DOM with AJAX to save, but I've got a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.