I have two choices for running a query and I'm curious to know which would be more efficient. And if there wouldn't be any significant difference in efficiency, is one more preferable to the other?
The first would return a query that would return a small number of rows and then I would run a sub query while processing each row which would return as many as 20 additional rows for each row in the first query. The first query would return about 10 rows with about 15 columns each, the second query would return about 20 rows with 4 columns for each row in the first query.
The second option would be to run 1 query which would return several hundred rows and break it up using loops within the my PHP script. Each of the several hundred rows is going to contain about 20 columns.
If I use the second option, each row is going to contain all the data from both queries.
2007-10-16
16:38:19
·
5 answers
·
asked by
Justin H
7
in
Computers & Internet
➔ Programming & Design