MichaelTaylor3D
MichaelTaylor3D

Reputation: 1665

Heavy vs light queries

When you have an application that is constantly querying a database for information, in terms of performance, and database usage, is it better to have one big query that pulls in all the data at once or is it better to have a bunch of smaller query's that pull in the data one at a time. Does it matter?

Im trying to figure out if I should query my entire class once any value in the class is requested. Or to only query individual values as they are needed.

Upvotes: 2

Views: 426

Answers (1)

Kermit
Kermit

Reputation: 34063

If others are paying for your usage, I would recommend pulling as much data as you can in a single connection and work with it locally. However, I don't know what 'usage' is defined as. It could be connections, bandwidth, operations, etc.

Upvotes: 2

Related Questions