Hi there,
I am having a debate with my co-worker and I hoped some of you could lend some insight.
Is it better to issue an SQL statement that limits the number of items returned based on your query? or, Is it better to return all the items from the table and then use a higher level language like Java or C++ to sort through the result set one by one?
Such as, what if I want to query table A that has 1,000,000 entries, each having 5 columns. Is it better to return all the results to find entries 'foo' and 'bar', or 'foo' through 'bar' or just limit the results statement at the SQL level?
I say it's better to limit it at the SQL level, to reduce the load on the client computer.
Consider you answers, would they be the same if the table have 100 entires? or 100,000 entries? How about several million entries?
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;
I am having a debate with my co-worker and I hoped some of you could lend some insight.
Is it better to issue an SQL statement that limits the number of items returned based on your query? or, Is it better to return all the items from the table and then use a higher level language like Java or C++ to sort through the result set one by one?
Such as, what if I want to query table A that has 1,000,000 entries, each having 5 columns. Is it better to return all the results to find entries 'foo' and 'bar', or 'foo' through 'bar' or just limit the results statement at the SQL level?
I say it's better to limit it at the SQL level, to reduce the load on the client computer.
Consider you answers, would they be the same if the table have 100 entires? or 100,000 entries? How about several million entries?
Thanks,
Ron
typedef map<GiantX,gold, less<std::shortestpathtogold> > AwesomeMap;