GridMatch, an efficient algorithm for evaluating left hand side bindings in a secondary memory environment, is described. Matching is incremental and the algorithm is state saving. Since the working-memory database and matching state are too large to fit in the main memory, careful implementation becomes crucial. GridMatch uses partitioned storage to reduce matching time. The time and space complexity of the algorithm is analyzed in detail. The algorithm was implemented in a file system environment. Results show that substantial savings in matching cost are obtained with little space overhead. As expected, matching becomes very computationally intensive in a secondary memory environment, and efficient algorithms are a must for successful integration of production systems and databases. The well-known optimization of common subcondition evaluation is applicable to GridMatch, and it is also easily parallelizable.