Need an Opinion High Processing Vs High Database Queries
-
Hello! I am at a point in my project where.... i could get the informtion which i require by running... A query to find all the valid elements....... which is 1000's and then running a another 2-3 queries on each of these 1000 results. It seems quite alot of database processing. The other way i can do it is. Obtain all the relvent information at the start and manually process it. My question is what would you do I am using Microsoft SQL Server and asp.net with c# I basically need to know if there is any advantages/disadvantages over High Processing Vs Several SQL queries I may be being naive and thinking this amount of queries is wasteful and thats why i have considered the processing method. Atul
-
Hello! I am at a point in my project where.... i could get the informtion which i require by running... A query to find all the valid elements....... which is 1000's and then running a another 2-3 queries on each of these 1000 results. It seems quite alot of database processing. The other way i can do it is. Obtain all the relvent information at the start and manually process it. My question is what would you do I am using Microsoft SQL Server and asp.net with c# I basically need to know if there is any advantages/disadvantages over High Processing Vs Several SQL queries I may be being naive and thinking this amount of queries is wasteful and thats why i have considered the processing method. Atul
i am doing a similar project, but it seems my project has a few more queries... it automatically updates around between 25,000 and 85,000 rows every 3 hours or so, for each 'update' there is additional processing to be done on every record, including an insert into a secondary table, i found the fastest method was to do most of processing in a stored procedure and have each update and insert only be one stored procedure call (with about 8 queries, ifs, updates, inserts etc inside), rather then a string of seperate queries, i found that having seperate queries really slowed down the process, i also have a "permanently" open sql connection for each of the threads that are doing the updating. also, since the biggest bottleneck in my application is these updates, i don't have any indexes, since the majority of the work is updates/inserts the other thing i did, since the updates are done by a single program, with individual records being affected, was to disable locking...
-
i am doing a similar project, but it seems my project has a few more queries... it automatically updates around between 25,000 and 85,000 rows every 3 hours or so, for each 'update' there is additional processing to be done on every record, including an insert into a secondary table, i found the fastest method was to do most of processing in a stored procedure and have each update and insert only be one stored procedure call (with about 8 queries, ifs, updates, inserts etc inside), rather then a string of seperate queries, i found that having seperate queries really slowed down the process, i also have a "permanently" open sql connection for each of the threads that are doing the updating. also, since the biggest bottleneck in my application is these updates, i don't have any indexes, since the majority of the work is updates/inserts the other thing i did, since the updates are done by a single program, with individual records being affected, was to disable locking...