Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

MYSQL/Dataminer Slow Query

Solved1.32K views16th March 2023database MySQL trending table
2
Ryan Reuss [SLC] [DevOps Member]490 20th April 2022 0 Comments

Hello Dojo,

This specific MYSQL query is from a 17GB trending table and was found in the slow query log file as taking 28min.

2022-04-04 14:29:10.714|161| Database: SLDMADB | time: 1704031ms | query:
DELETE FROM DATAAVG_40701_3217 WHERE
((iStatus < 0 AND dtFirst < ‘2021-04-03 13:36:46’) OR
(iStatus = 5 AND dtFirst < ‘2022-03-04 13:36:46’) OR
(iStatus = 60 AND dtFirst < ‘2021-04-03 13:36:46’) OR
(iStatus = 120 AND dtFirst < ‘2021-04-03 13:36:46’)) AND iId NOT IN (Followed by thousands of parameters here)

This customer had another table that was much larger than this one, but I was not able to find any record of it in these slow query log files. Is there a cut off point where Dataminer will abort a query such as the one above if it takes more than 30 min to complete and any reason this wouldn’t be logged somewhere?

Thank you for any info and kind regards,

Ryan Reuss [SLC] [DevOps Member] Selected answer as best 16th March 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Wouter Demuynck [SLC] [DevOps Advocate]5.94K Posted 21st April 2022 2 Comments

Hi Ryan,

As far as I know, any timeouts or slow queries should be logged (SLDatabase[xxx].txt)

The 30-minute query timeout gets applied by DataMiner for MySQL queries and cannot currently be configured differently.

I guess it could very well be that cleaning the larger table is not a problem because the list of “NOT IN” ids is shorter. The slow query is probably more because of the “NOT IN” list than because of the table size.

As for the listed query with the huge “NOT IN” list: in some scenario’s the list of NOT IN values can grow infinitely over time, eventually breaking the cleanup (which then leaves a table that never gets cleaned out)

Reason is that for every trended table cell, DataMiner always keeps at least one point (the oldest) in the database to be able to display stable values properly. This can give problems for rows that only exist temporarily.

If the cleanup fails, a workaround is to make a scheduled task e.g. every month that runs the exact same query but without the NOT IN values. This will delete all the obsolete points and will reduce the list significantly, however small downside is that if you have a point that never changed in a year and actually still is present in the table in Cube this will result in an empty trend graph (or a warning that there is no trending present, depending on your version)

Example of such a query:

DELETE FROM DATAAVG_40701_3217 WHERE
((iStatus < 0 AND dtFirst < ‘2021-04-03 13:36:46’) OR
(iStatus = 5 AND dtFirst < ‘2022-03-04 13:36:46’) OR
(iStatus = 60 AND dtFirst < ‘2021-04-03 13:36:46’) OR
(iStatus = 120 AND dtFirst < ‘2021-04-03 13:36:46’))

(this is no longer a concern on Cassandra as the cleaning logic works differently)

Ryan Reuss [SLC] [DevOps Member] Selected answer as best 16th March 2023
Jeff Douglass commented 21st April 2022

Wouter, am I correct in assuming that when DM is restarted, each and every trended parameter will have an entry added to the database so if DM was restarted say within the last 30 days there would be no risk of any blanks in the database due to deleting the last logged point on a parameter that has not changed since that point in time? Thanks

Wouter Demuynck [SLC] [DevOps Advocate] commented 22nd April 2022

Hi Jeff, I indeed believe that your assumption is correct and that a new data point will be written on every DMA restart (most likely also on element restart)

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs