Skip to main content
Question

centreon_storage.data_bin table schema design?

  • 27 May 2024
  • 4 replies
  • 55 views

Is there a reason why ctime column on data_bin table is not indexed?

Without indexes partitioning and purging requires a full table scan, and with performance metrics collection this table can get _extremely_ large which makes aforementioned tasks very slow, I am  now watching a purge processwhich has been running several days now ..

4 replies

Userlevel 5
Badge +14

Hello

you should enable partitionning on the data_bin table

this is made especially to allow ffor quick purging as the partitionning is done on the ctime column

and it why it is not indexed, the partitionning is doing it implicitly

 

I would suggest you to enable partitionning, here is a procedure to migrate to a partitionned database : Database partitioning | Centreon Documentation

 

Badge +4

Partitioning is enabled, tasks are super slow regardless

Userlevel 5
Badge +14

mmh that is extremely strange, when you go in Platform status /  Databases, do you have something like this : 

 

as you can see I have around 500Mb per partition, for 19k services

 

the log is saying it take 7 sec to purge every day

 

Userlevel 2
Badge +9

I think he is deleting rows by hands not purging by dropping partition.

That’s why it takes ages.

@thakala you are not supposed to do this way, you must set your retention here :  Administration  >  Parameters  >  Options

and wait the crontab to run and drop the old partitions.

Reply