SQL query performance optimization on Huge amount of data

Arutprakasam 261 Reputation points
2023-12-01T07:58:48.5866667+00:00

Hi ,

Please find the disk and number rows details on each table.

Especially actual_data and alert_log table we are doing insert option every 10secs with 2060 records and same time we are executing the 1024 select query to do the some functionality.

During this time, I am facing the timeout error, lock error, insert errors and select query taking too much of time and throwing timeout error.

I want to overcome the above issues.

Kindly please share the best practices and suggest ideas and if possible.

  • Disk space used for each table per dayUser's image
  • Disk space used for a day/monthly/yearlyUser's image
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2023-12-01T22:08:00.8566667+00:00

    The data you post does not have much relation to the problems you seem to be facing. Rather, it seems that you need to perform traditional query tuning. That is, find better indexes and rewrite queries if they are written in a way that prevents efficient use of indexes.

    If you have not enabled Query Store for your database to do. Query Store is a great tool to determine which are the slow queries in a system.

    0 comments No comments

  2. Anonymous
    2023-12-04T02:09:16.6266667+00:00

    Hi @Arutprakasam

    You can refer to this post for Query optimization.

    https://www.sql-easy.com/learn/how-to-improve-sql-query-performance/

    Best regards,

    Percy Tang

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.