Comments (4)
Done, included in CQEngine 1.0.3.
I made some minor changes to the patch:
- If an object is added to the IndexedCollection and it already exists in UniqueIndex, UniqueIndex will not throw an exception if the condition newObject.equals(existingObject) is true. This change brings UniqueIndex in line with the behaviour of other indexes (which safely can be notified multiple times about the same object), to avoid the need to add special logic for UniqueIndex in IndexedCollection
- I added support for MultiValueAttribute. Attribute values become the keys in the index, so there is no problem per-se in an object having a multiple values for an attribute. The object will be added to the index multiple times, against one key for each of its attribute values.
Multi-valued attributes can be used with unique index, as long as there is no
overlap in values between objects. For example Car{features=radio,cd_player}
and Car{features=sunroof,spare_tyre} can both be added to a UniqueIndex. But a
third Car{features=alarm,sunroof} would cause an exception because there would
already be an entry for sunroof. This is a contrived example, but some
applications might have fields which contain multiple but naturally disjoint
values, for example foreign key-type references, like
Customer{List<CustomerOrder>}.
This will be a great addition so thanks again to Kinz Liu.
Original comment by [email protected]
on 7 Dec 2012 at 10:46
- Changed state: Done
from cqengine.
I updated the benchmark page: http://code.google.com/p/cqengine/wiki/Benchmark
UniqueIndex is *significantly* faster:
3600% faster than HashIndex at indexing unique attributes
30% faster than HashIndex in query performance
Actual figures are here: http://cqengine.googlecode.com/svn/wiki/documents/
Original comment by [email protected]
on 8 Dec 2012 at 12:02
from cqengine.
I see the above patch missing in IndexedCollectionImpl.java in the latest
release 1.2.1. Any reason this was not included in the release?
Original comment by [email protected]
on 8 Oct 2013 at 9:31
from cqengine.
No features were removed AFAIK. UniqueIndex is still there (it's a core
feature).
IndexedCollectionImpl no longer exists however. In version 1.1.0 it was renamed
to ConcurrentIndexedCollection, because an additional implementation
ObjectLockingIndexedCollection was also added.
What was in IndexedCollectionImpl.java is now in
ConcurrentIndexedCollection.java, so see that class instead. Let me know if you
don't find what you are looking for!
Original comment by [email protected]
on 8 Oct 2013 at 9:59
from cqengine.
Related Issues (20)
- Auto-generate attributes HOT 2
- FilteringIterator.hasNext advances iterator every time it is called. HOT 6
- Recommendation on ID indexes HOT 1
- And.calcHashCode being performance Bottlneck HOT 11
- Set.add semantics is not perfect. HOT 4
- Set remove() and removeAll() doesn't follow substitutability principle. HOT 4
- Add listeners (observers) to IndexedCollection HOT 5
- Add support for query "dialects" like SQL HOT 2
- Documentation for selective READ_COMMITTED transaction isolation using RW lock HOT 2
- Support lock-free READ_COMMITTED transaction isolation via multiple buffering HOT 2
- DeduplicationStrategy.MATERIALIZE broken in 1.2.4 HOT 1
- Modify Or/And to allow only one child. HOT 2
- Comparing two objects? HOT 1
- ObjectLockingIndexedCollection's StripedLock does not handle negative hashcodes HOT 1
- Multiversion concurrency control(MVCC) should be implemented for transaction isolation HOT 2
- Query CONSISTENTLY slower with the addition of NavigableIndex HOT 1
- Provide the way to determine how much memory used by index HOT 2
- Attribute#getValues to return Iterable HOT 1
- deduplication not return duplicate objects from the collection HOT 3
- IllegalArgumentException when ResultSet.getMergeCost() changes during query HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cqengine.