Stefan Jakobs: > > Does the database support a first/next operation? > > The operation which comes close to that, is to select the whole table and > then > fetch the keys row by row. Yes, I think that is a first/next operation (with > a > bad performance). > > What would be the answer if there wasn't a first/next operation?
A DBMS without iterator does not seem plausible. The dict_cache cleanup code slowly scans the DBMS for obsolete records and removes them while allowing the verify or postscreen process to handle requests from other Postfix processes. This means that the MySQL client will need to handle two streams of requests that are interleaved: 1 - One stream of first/next/lookup/delete requests from the cache cleanup code. 2 - One stream of lookup/update requests that are triggered by smtpd (lookup) and by delivery agents (update). These two streams must be able to co-exist. Cache cleanup can take a long time, and it is not acceptable that the cache cleanup (stream 1) must run from start to completion without allowing requests from stream 2. Wietse