You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several ways to map identifiers to tables and they all have their pros and cons.
The naïve way
By far the easiest way would be to simply define a table which holds the information:
id INTNOT NULL auto_increment,
hostname VARCHAR(64) NOT NULL DEFAULT "localhost"
plugin VARCHAR(64) NOT NULL,
plugin_instance VARCHAR(64) NOT NULL,
type VARCHAR(64) NOT NULL,
type_instance VARCHAR(64) NOT NULL,
UNIQUE(hostname, plugin, plugin_instance, type, type_instance),
The advantage of this layout it that it's easy. It's easy to read, easy to add rows to and will only require a single SQL statement to get the ID for a specific identifier. The disadvantage is that data is being held redundantly. If there are 200 values for a host, there will be 200 rows in this table which have the same value for hostname..