Sunday, 1 September 2013

Performing one query or multiple queries in MySQL?

Performing one query or multiple queries in MySQL?

Is it better to do this query once:
SELECT * FROM foo WHERE id = 5
Or will it be better to perform queries like the following (getting one
column at a time) 3-5 times, to only retrieve the specific columns you
need, and as you need them?
SELECT col1 FROM foo WHERE id = 5
SELECT col2 FROM foo WHERE id = 5
SELECT col FROM foo WHERE id = 5
.......

No comments:

Post a Comment