Re: what is the speed hit of "SELECT *" with MySql, as opposed to narrower database calls?
- From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 13:44:00 +0200
*** lkrubner@xxxxxxxxxxxxx wrote/escribió (9 Apr 2005 12:40:13 -0700):
> SELECT * FROM weblogs
>
> as opposed to
>
> SELECT id, headline FROM weblogs
The query itself is faster with *. Performance issues arise when you are
reading fields you don't need, which can happen:
* When your script doesn't use all table fields.
* If you add new fields to a table and do not edit *all* the scripts that
use these tables.
Performance gain with * is minimal but potential loss is huge: imagine you
add a BLOB field to store files (let's say, a picture of the country) and
retrieve the complete image from DB everytime you want to create a <select>
field to choose countries.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.
- Follow-Ups:
- References:
- Prev by Date: multiple rows and alternate color
- Next by Date: parsing XML file
- Previous by thread: Re: what is the speed hit of "SELECT *" with MySql, as opposed to narrower database calls?
- Next by thread: Re: what is the speed hit of "SELECT *" with MySql, as opposed to narrower database calls?
- Index(es):
Relevant Pages
|