Oracle clob performance and CopyLocator
Posted: 18.04.2024, 11:56
Hi all,
I've been doing some testing on Clobs and found that with cache modes of None or OnAccess that retrieving clobs is three to four times slower than when using OnLoad caching. I managed to gain a little performance by consolidating some of the OCILobGetLength2 calls, but it took a while to figure out what else was happening. I managed to track it down to the CopyLocator function which uses OCILobLocatorAssign. Removing the call appears to fix the performance issue completely, but, of course, I'm hesitant to just remove something that I don't understand the purpose of. In my limited testing I haven't seen any differences with the change (besides it being three times faster lol.) I do notice that another Oracle library I have access to doesn't use OCILobLocatorAssign at all. The documentation seems to indicate that lob locators (or more appropriately pointers to lob locators) can be directly copied (which seems to bear out in my testing.) Anyone have any knowledge on this? Thanks!
-Mark
I've been doing some testing on Clobs and found that with cache modes of None or OnAccess that retrieving clobs is three to four times slower than when using OnLoad caching. I managed to gain a little performance by consolidating some of the OCILobGetLength2 calls, but it took a while to figure out what else was happening. I managed to track it down to the CopyLocator function which uses OCILobLocatorAssign. Removing the call appears to fix the performance issue completely, but, of course, I'm hesitant to just remove something that I don't understand the purpose of. In my limited testing I haven't seen any differences with the change (besides it being three times faster lol.) I do notice that another Oracle library I have access to doesn't use OCILobLocatorAssign at all. The documentation seems to indicate that lob locators (or more appropriately pointers to lob locators) can be directly copied (which seems to bear out in my testing.) Anyone have any knowledge on this? Thanks!
-Mark