Patent ID: 8352459

Claim:
A computer implemented method for optimizing queries for a Simple Network Management Protocol Management Information Base, the computer implemented method comprising: a Simple Network Management Protocol client receiving a source query defined in structured query language to access data stored in one or more Management Information Base tables; parsing the source query into one or more queries and sub-queries; applying sets of optimization rules and heuristics to the parsed source query to generate a query execution plan for each set of optimization rules and heuristics applied to the parsed source query; selecting an optimal query execution plan from the generated query execution plans; rewriting the parsed source query into a Simple Network Management Protocol construct using the optimization rules and heuristics specified in the optimal query execution plan to form a Simple Network Management Protocol-based query; and the Simple Network Management Protocol client using the Simple Network Management Protocol-based query to retrieve the data requested by the source query without performing a full scan of the one or more Management Information Base tables to locate the data, wherein applying sets of optimization rules and heuristics to the source query further comprises: determining whether the source query returns a single row from a Management Information Base table in the one or more Management Information Base tables; and responsive to a determination that the source query or subquery returns a single row from a Management Information Base table, applying a direct index query optimization rule to the source query, wherein the direct index query optimization rule is used to translate the source query into a single Simple Network Management Protocol Get operation that returns a single row from the Management Information Base table.