NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: Query taking too much resourses on the database  (Read 134 times)

isoftcom

  • Newbie
  • *
  • Posts: 4
    • View Profile
Query taking too much resourses on the database
« on: November 19, 2018, 04:00:16 pm »

Hi All,

The Query "INSERT INTO tdata_122 (item_id,tdata_timestamp,record_id) VALUES (:1,:2,:3)" is very expensive, it causes all sorts of problems with the Database including the creation of deadlocks and waits. Isn't there a way we can optimize it so as to make is less expensive on resources.
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6383
    • View Profile
Re: Query taking too much resourses on the database
« Reply #1 on: November 21, 2018, 09:04:35 am »

HI,

we need much more detailed problem description to attempt to fix that. This query is one of the most common (save collected DCI data). What database you are using? How big is your database and this table? Could you provide execution plan for it? Is problem only with idata_122 table or with other idata_ tables as well? Do you have active reads from that table (it could be charts refreshed very often or some scripts reading collected data)?

Best regards,
Victor
Logged