orientdb
orientdb copied to clipboard
Elliminate constant acquisition of state lock in storage during storage operations
Currently, every operation in storage requires the acquisition of a storage state lock that leads to a slowdown during the execution of queries. But we can avoid that by moving the execution of the query underneath the storage. The idea is simple: we already have mechanics that allow us to replace storage instances for the current session in the database.
So before the execution of the query, we acquire state lock. Then, we replace storage with the internal class with the same interface that provides access to storage methods without acquiring a state lock.
That is relatively quick to implement and will bring improvements in the speed of query execution.
We can implement this for all non-DDL queries.