Which is the fastest win32 or SQL query?

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

My question is, how less resources are consumed and optimal to make a split in the SQL query (possibly a storage procedure) or calculate the value in the code for this field (server side)? I do not want to use TDataset with computed fields.

The Oracle system (v 9.2) is also used by other applications, it is not intended only for this application.

Thanks in advance.

+6
winapi delphi delphi-7
source share
4 answers

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

Always perform SQL processing tasks on the database server that is designed for this.

+8
source share

With such a scalar operation, the difference in performance will be trivial. Depending on what is semantically more sensible or more convenient.

+7
source share

how less consumes resources and is it optimal to make a division into an SQL query (possibly a repository procedure) or to calculate the value in the code for this field (server side)?

Irrelevant. Most of the time will be spent calculating and passing 100,000 lines.

+5
source share

If the performance is the same, I would do it in the place where it would be the most convenient for maintenance / configuration. If a special maintenance window is required to change the database (for example, Saturday at midnight), I would choose a client or middle-tier solution using the stored procedure.

+4
source share

All Articles