Skip to main content

Hello

I have a lot of duplicate entries in Administration  >  Parameters  >  Data :

 

How can I find, for each duplicate, which one is useless and delete it ?

 

for example, the two metrics framed in orange in my screenshot refers to

index_id=1762 for the first line
index_id=11266 for the second line

 

in DB : 

MariaDB ecentreon_storage]> select metric_id,index_id from metrics where index_id=1762;
+-----------+----------+
| metric_id | index_id |
+-----------+----------+
| 11842 | 1762 |
| 11843 | 1762 |
| 11844 | 1762 |
| 11845 | 1762 |
| 11846 | 1762 |
| 11847 | 1762 |
| 11848 | 1762 |
| 11849 | 1762 |
| 11850 | 1762 |
| 11851 | 1762 |
+-----------+----------+
10 rows in set (0.001 sec)

MariaDB /centreon_storage]> select count(*) from data_bin where id_metric >= 11842 AND id_metric <= 11851;
+----------+
| count(*) |
+----------+
| 144160 |
+----------+



MariaDB /centreon_storage]> select metric_id,index_id from metrics where index_id=11266;
+-----------+----------+
| metric_id | index_id |
+-----------+----------+
| 2742 | 11266 |
| 2743 | 11266 |
| 2744 | 11266 |
| 2745 | 11266 |
| 2746 | 11266 |
| 2747 | 11266 |
| 2748 | 11266 |
| 2749 | 11266 |
| 2750 | 11266 |
| 2751 | 11266 |
+-----------+----------+
10 rows in set (0.001 sec)

MariaDB /centreon_storage]> select count(*) from data_bin where id_metric >= 2742 AND id_metric <= 2751;
+----------+
| count(*) |
+----------+
| 150 |
+----------+

 

Anyone has an idea about the method to remove duplicate entries ?

Be the first to reply!

Reply