Garbage in database tables

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
temoon
Posts: 4
Joined: Thu Feb 28, 2008 5:36 am
Contact:

Garbage in database tables

Post by temoon »

Hi, Developers.

Before, sorry for my english... ;)

Ok. Let's go...
1st: We have two Data Inputs for source like

Code: Select all

a:1 b:1 c:1
and

Code: Select all

a:1 b:1 d:1 e:1 f:1
This shows, what we have in `data_input_fields` table anythink like this

Code: Select all

+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| id  | data_input_id | name            | data_name | input_output | update_rra | sequence | type_code |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| 418 |            26 | F               | f         | out          | on         |        0 |           | 
| 416 |            26 | E               | e         | out          | on         |        0 |           | 
| 417 |            26 | D               | d         | out          | on         |        0 |           | 
| 419 |            26 | B               | b         | out          | on         |        0 |           | 
| 415 |            26 | A               | a         | out          | on         |        0 |           | 
| 105 |            26 | Hostname (FQDN) | hostname  | in           |            |        2 | hostname  | 
| 106 |            26 | Source Filename | filename  | in           |            |        1 |           | 
| 109 |            68 | C               | c         | out          | on         |        0 |           | 
| 110 |            68 | B               | b         | out          | on         |        0 |           | 
| 111 |            68 | A               | a         | out          | on         |        0 |           | 
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
10 rows in set (0.00 sec)
2nd: I am merge this two Data Inputs in one (delete 1st one of this and add some values in other), and have like this

Code: Select all

+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| id  | data_input_id | name            | data_name | input_output | update_rra | sequence | type_code |
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
| 418 |            26 | F               | f         | out          | on         |        0 |           | 
| 416 |            26 | E               | e         | out          | on         |        0 |           | 
| 417 |            26 | D               | d         | out          | on         |        0 |           | 
| 509 |            26 | C               | c         | out          | on         |        0 |           | 
| 419 |            26 | B               | b         | out          | on         |        0 |           | 
| 415 |            26 | A               | a         | out          | on         |        0 |           | 
| 105 |            26 | Hostname (FQDN) | hostname  | in           |            |        2 | hostname  | 
| 106 |            26 | Source Filename | filename  | in           |            |        1 |           | 
+-----+---------------+-----------------+-----------+--------------+------------+----------+-----------+
8 rows in set (0.00 sec)
3rd: But "link" to data input field, what was deleted, hold stay in `data_template_rrd` table. All unused (broken) lines I have selected like this:

Code: Select all

SELECT * FROM `data_template_rrd` a WHERE a.`data_input_field_id` NOT IN (SELECT b.`id` FROM `data_input_fields` b);
I have like 1800 unused lines for half of year of work... O.o
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests