Giter Site home page Giter Site logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.