1. A computer-implemented method for improving the performance of a database management system (DBMS), the method comprising: identifying a locally invariant variable in general DBMS code that executes a portion of a query whose value is invariant or takes on a deterministic sequence of values within a query evaluation loop; identifying DBMS code that is rendered unnecessary due to the variable being locally invariant; generating micro-specialized DBMS code to replace the DBMS code identified as being unnecessary due to the locally invariant variable, wherein when executed, the micro-specialized DBMS code performs the same function as the unnecessary DMS code with fewer instructions; and modifying the general DBMS code such that the generated micro-specialized DBMS code is executed instead of the unnecessary DBMS code during execution of the query evaluation loop.