[Nagios-devel] NDO: Setting instance_id as key in more tables?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] NDO: Setting instance_id as key in more tables?

Post by Guest »

------=_Part_376547_99566.1177944775496
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi devels,
Im developer of visualization tool Nagvis. I worked a bit on the NDO backend
to optimize the queries to the DB. I recognized that the field instance_id
is not a part of an index/key in some (or some more) tables.

For example we query the following tables in one query:
- nagios_objects and nagios_hoststatus (To get the hoststatus)

- nagios_objects and nagios_servicestatus (To get the servicestatus)

- nagios_objects and nagios_hostgroups (To get the ID of a hostgroup)
- nagios_objects and nagios_hostgroup_members (To get the members of a
hostgroup)

- nagios_objects and nagios_servicegroups (To get the ID of a servicegroup)
- nagios_objects and nagios_servicegroup_members (To get the members of a
servicegroup)

In all cases were filtering the datasets by the instance_id. But not in all
tables the field "instance_id" is indexed or a (part of a) key. I'm not the
mysql geek but I think it would be good to make the field "instance_id" in
table nagios_objects as a key - or a part of a key.
This should make the selects much more faster.

I just had a look at the queries distributed in the ndo package, I
recognized there are always joins to nagios_hosts/nagios_services etc. I
think a JOIN to the table only for checking if this is the correct
"instance_id" is to much overhead.

Some comments/ideas?

Regards,
Lars

------=_Part_376547_99566.1177944775496
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi devels,
Im developer of visualization tool Nagvis. I worked a bit on the NDO
backend to optimize the queries to the DB. I recognized that the field
instance_id is not a part of an index/key in some (or some more) tables.

For example we query the following tables in one query:
- nagios_objects and nagios_hoststatus (To get the hoststatus)

- nagios_objects and nagios_servicestatus (To get the servicestatus)

- nagios_objects and nagios_hostgroups (To get the ID of a hostgroup)
- nagios_objects and nagios_hostgroup_members (To get the members of a
hostgroup)

- nagios_objects and nagios_servicegroups (To get the ID of a servicegroup)
- nagios_objects and nagios_servicegroup_members (To get the members of
a servicegroup)

In all cases were filtering the datasets by the instance_id. But not in
all tables the field "instance_id" is indexed or a (part of a) key. I'm
not the mysql geek but I think it would be good to make the field
"instance_id" in table nagios_objects as a key - or a part of a key.
This should make the selects much more faster.

I just had a look at the queries distributed in the ndo package, I
recognized there are always joins to nagios_hosts/nagios_services etc. I
think a JOIN to the table only for checking if this is the correct
"instance_id" is to much overhead.

Some comments/ideas?

Regards,
Lars

------=_Part_376547_99566.1177944775496--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked