Giter VIP home page Giter VIP logo

Comments (9)

luigidellaquila avatar luigidellaquila commented on June 3, 2024

Hi @fppt

Since v.2.2 unique indexes also consider null values. You can disable this setting when you create the index setting ignoreNullValues=true, see http://orientdb.com/docs/2.2.x/SQL-Create-Index.html

Anyway, I suggest you not to use it, because indexes without null values cannot be used for some query optimizations, so you will lose performance in some corner cases

Thanks

Luigi

from orientdb-gremlin.

luigidellaquila avatar luigidellaquila commented on June 3, 2024

I just checked that docs page, it contains some outdated info. In v 2.2 null values are NOT ignored by default.
I'm fixing it now

Thanks

Luigi

from orientdb-gremlin.

fppt avatar fppt commented on June 3, 2024

Thanks @luigidellaquila. For the time being is there a way to disable indexing nulls using the available API of this plugin?

from orientdb-gremlin.

luigidellaquila avatar luigidellaquila commented on June 3, 2024

How are you creating the index? Is it a single key index?

Thanks

Luigi

from orientdb-gremlin.

fppt avatar fppt commented on June 3, 2024

I create it as follows:

BaseConfiguration indexConfig = new BaseConfiguration();
indexConfig.setProperty("keytype", OType.String);
indexConfig.setProperty("type", "UNIQUE");
graph.createVertexIndex("prop1", "label1", indexConfig);

from orientdb-gremlin.

luigidellaquila avatar luigidellaquila commented on June 3, 2024

I think this should be enough:

BaseConfiguration indexConfig = new BaseConfiguration();
indexConfig.setProperty("keytype", OType.String);
indexConfig.setProperty("type", "UNIQUE");

indexConfig.setProperty("metadata.ignoreNullValues", true);

graph.createVertexIndex("prop1", "label1", indexConfig);

Thanks

Luigi

from orientdb-gremlin.

fppt avatar fppt commented on June 3, 2024

I added indexConfig.setProperty("metadata.ignoreNullValues", true); no joy sadly. Still getting the same exception.

from orientdb-gremlin.

Eric24 avatar Eric24 commented on June 3, 2024

@luigidellaquila : Can you expand on your statement to not use "unique, ignored-nulls" indexes because of optimization issues in some edge cases? It's something we're doing quite a bit of (in cases where a property is often the same for 99% of the documents, but we need to quickly find the other 1%). I haven't seen any roblems, but I'd like to understand what to watch out for.

from orientdb-gremlin.

luigidellaquila avatar luigidellaquila commented on June 3, 2024

Hi @Eric24

The query execution planner used to skip index usages in some conditions, when the index was configured to exclude null values. Anyway, in v 3.0 and with the new execution planner we solved this problem, so it's not a concern anymore

Thanks

Luigi

from orientdb-gremlin.

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.