问题
I'm considering CQEngine for a project where I need to handle lots of real time events and execute some queries from time to time. It works well for returning the results but I noticed that the larger the collection gets the slower it becomes to add or remove elements to/from it.
I have a few simple indexes added on the collection so I'm assuming the delay is because on each event added/removed the indexes are updated. I also get an OutOfMemoryError on large numbers of events, from the indexes increasing along with the collection I think.
So my question is, what is the indexing penalty in CQEngine for a fast changing collection (elements often added and removed from the collection)?
回答1:
If you have a lot of unique values in attributes that you index, you would probably benefit from IndexQuantization discussed on the site.
This is a way to tune the tradeoff between memory usage and retrieval speed. But it's especially useful to reduce the size of indexes in memory, if you have a large number of unique values.
FYI you can also ask questions in the CQEngine discussion forum.
Hope that helps!
来源:https://stackoverflow.com/questions/23119394/what-is-the-indexing-penalty-in-cqengine-for-a-fast-changing-collection