Code Performance: SQL Server Query vs C # .Net Web Application

I write complex logic to calculate sales and customer bonuses. I have a million entries for calculating bonuses.

I want to get expert opinions so that the mathematical operation does not take much time to display the result on a web page.

So where do I need to write the calculation part? In SQL Server queries (using stored procedure and functions) or ASP.NET and C # .Net (business logic level)?

Which of the best? Processing on a database server or Processing on an application server?

Hi

Mohsin JK

+6
source share
2 answers

If you have millions of records, I would suggest you write part of the calculation in SQL Server, since calculations in Business Layer take significantly more time.

The following are recommendations for increasing productivity -

  • Recording Stored Procedures
  • Create Indexes for Quick Recordings
  • Using temporary tables if manupulation for huge records

You can search the web to find other T-SQL performance optimization methods.

+4
source

I have a million entries for calculating bonuses

I think it’s better to compute it in the database in order to avoid transferring large amounts of data from the database to the application.

+1
source

Source: https://habr.com/ru/post/913493/


All Articles