Making Actian Zen Btrieve API Code More Efficient By Diana Lewis March 9, 2018 The release of Service Pack 1 for Zen (PSQL) v13, Actian’s zero-dba, embedded nano-footprint database, provides a number of new features, including one we’re looking at today to make Btrieve API code more efficient — the GetNextExtended LIKE Support. First, let’s review the concept of “Extended Operations.” The low-level Btrieve API (also known as the Microkernel API) supports a set of functions, called extended operations, which allows a developer to quickly obtain many records (or even pieces of records) from the database in a single function call, saving substantially on the number of network requests, and therefore the time needed to retrieve data from the database engine. The extended operations calls also support the concept of “filtering”, which is similar to a SQL WHERE clause — it allows the database engine to read through the records and reject any that don’t meet the specified filter criteria. By limiting the data being sent back to the application to ONLY those records which are needed by the application, this further improves performance. GetNextExtended requests can be used automatically within the Magic 4GL development environment, but native API developers must carefully learn how to use them properly to experience these gains. (It is well worth the effort, though!) So, what is new in v13.10? The extended operations filters now support a LIKE function for substring matching, similar to SQL. You can now find all “Smith” records in your customer database by simply using the LIKE option and searching for “% Smith” records. Or, maybe you want Smithson as well, so you can search for “%Smith%”. Do you want both Smith and Smyth returned? Use “%Sm_th%”! This promises to speed up any UI where the user can enter a portion of a string to look up data. If you are a developer and think you can start utilizing this function in your own code, you can find more information from the “What’s New Manual” or check out the on-line documentation here. We are hopeful that Actian will start utilizing this new functionality in the SQL engine as well, pushing LIKE filters down into the lower level MKDE and garnering performance gains there, too. You can learn more about Zen by visiting product page here (including information on the new IoT Server for Raspbian and Windows IoT Core) or by visiting the Actian Zen community forums here.