Actions
Refactor #2003
closedimprove pararmetize classes params retrivial speed
Description
Currently, when foreman search for a given parameter value, it would find the smart variable possible order and generate a few queries based on each matcher, for example:
SELECT "lookup_values".* FROM "lookup_values" WHERE "lookup_values"."match" = 'fqdn=host.example.com' AND ("lookup_values".lookup_key_id = 270) LIMIT 1 SELECT "lookup_values".* FROM "lookup_values" WHERE "lookup_values"."match" = 'domain=example.com' AND ("lookup_values".lookup_key_id = 270) LIMIT 1 SELECT "lookup_values".* FROM "lookup_values" WHERE "lookup_values"."match" = 'os=redhat 6.2' AND ("lookup_values".lookup_key_id = 270) LIMIT 1 . . .
since this happens for every parameter, this could eventually slow the system down.
an alternative approch would be to query to all possible values in one go, for example
LookupValue Load (0.2ms) SELECT "lookup_values".* FROM "lookup_values" WHERE "lookup_values"."match" = 'domain=example.com' AND "lookup_values"."lookup_key_id" IN (376, 270, 377, 275, 261)
Updated by Ohad Levy about 12 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset e76ac9ca4690f34791d726ccac41373e43616df6.
Actions