You could use EXPLAIN to see if there is a different query plan, but I'd
bet there isn't. * will generally be slower, just because you usually
won't need EVERY column. If you can specify only certain columns, that
will save you some time.

John

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kristoffer
Danielsson
Sent: Wednesday, October 28, 2009 12:51 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] SELECT * vs SELECT columns ?


I don't know about SQLite, but in all SQL courses you learn that you
should NEVER use the asterisk.

 

The asterisk is merely there to let you quickly view data _manually_.

 
> Date: Wed, 28 Oct 2009 16:02:01 +0200
> From: mi...@limbasan.ro
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SELECT * vs SELECT columns ?
> 
> I would expect there to be a speed and memory performance *impact* if 
> the result set contains columns other than the three specified ones, 
> since obviously the library will need to allocate more memory to hold 
> the extra data.
> 
> On 10/28/2009 03:52 PM, Pete56 wrote:
> > I am searching across two joined tables and am interested in a few
> > parameters:
> >
> > SELECT a.first a.third b.first FROM a JOIN b ON a.RowID = b.RowID
WHERE
> > value = :value
> >
> > Is there any speed or memory performance improvement by using SELECT
*,
> > rather than SELECT<specific columns> ?
> >
> > If I know there will only be one item (unique :value) selected
(LIMIT 1) can
> > I make any performance improvements ?
> > 
> 
> -- 
> Cu stima,
> Mihai Limbasan
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
                                          
_________________________________________________________________
Nya Windows 7 - Hitta en dator som passar dig! Mer information.
http://windows.microsoft.com/shop
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to