Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which is fastest win32 or SQL query?

I'm writing a client-server win32 application in Delphi 7 and in a section i need to bring aprox. 100k (less or more) rows with data from an Oracle database. Everything ok so far, but one of the fields must be calculated (a simple division with a large number).

My question is, how is less resources consuming and optimum, to make the division in the SQL query(maybe a store procedure), or to calculate the value in code for this field(on the server side)? I don't want to use a TDataset with calculated fields.

Oracle system(v 9.2) is also used by others applications, is not dedicated only to this application.

Thanks in advance.

like image 494
RBA Avatar asked Oct 07 '10 10:10

RBA


2 Answers

The SQL Engines are designed for this type of task, so the answer is make the operation in the oracle system.

Always do the SQL data manipulation tasks in the database server, which is designed for that.

like image 136
RRUZ Avatar answered Oct 24 '22 07:10

RRUZ


With such a scalar operation, the performance difference will be trivial. Do whichever is semantically more reasonable, or more convenient.

like image 44
Jon Hanna Avatar answered Oct 24 '22 06:10

Jon Hanna