List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:May 31 1999 1:07am
Subject:Re: Quick select question
View as plain text  
Darren Sweeney wrote:
> 
> Hi
> 
> This maybe a total SQL question, I don't know if different dB's work different ways.
> 
> I have a table with approx 20 columns.
> 
> If I only need 2 of the columns I still do:
> 
> SELECT * FROM users WHERE ( username like '$form{'USERNAME'}' )
> 
> and then use an array to pull, let's say $user[4] and $user[12]
> 
> Is there any speed/server load benefit on simply pulling the 2 columns needed, like:
> 
> SELECT username,password FROM users WHERE ( username like '$form{'USERNAME'}' )
> 
> Thanks all
> 
> Darren

The second version should work faster in most cases, as you are
transferring less data between the server and the client.

-- 
Sasha Pachev
http://www.sashanet.com
Thread
Quick select questionDarren Sweeney31 May
  • Re: Quick select questionSasha Pachev31 May
    • Re: Quick select questionEduardo Arino de la Rubia31 May