DEX 3.0 features: Indexed or not indexed attributes

Fourth episode of the series about DEX features. DEX is all about performance, with this feature we are focusing on improving query performance.

In the DEX graph every node and edge can have as many attributes as needed. Those attributes were automatically indexed in order to improve query performance, but it also had a negative turn in means of space cost and loading time. However not every attribute is used in queries so why do we have to pay a performance penalty for attributes that will never be queried? In DEX 3.0 it’s the developers’ choice which attributes should be indexed and which ones are not, improving substantially the global performance. Use public long newAttribute(int type,java.lang.String name, short datatype, short kind) and choose among the following attributes types for “kind”:

  • Graph.ATTR.KIND_BASIC: allows storing a value for each object but they can’t be used at query methods.
  • Graph.ATTR.KIND_INDEXED: attributes will be indexed for querying.
  • Graph.ATTR.KIND_UNIQUE: attributes are indexed and adds a restriction to not accept objects with the same value (only null values can be duplicated).

This feature makes developers more aware of performance when creating objects for their graph optimizing where it’s more meaningful.

Hope you find this issue interesting. Do not forget to check latest posts in case you missed them: graph algorithms, regular expressions or neighbors materialized.

This entry was posted in DEX, Documentation and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>