Null Query and Count Query take too long to execute

67 views
Skip to first unread message

Hung Tran

unread,
Dec 24, 2015, 2:11:03 AM12/24/15
to orient-...@googlegroups.com
Hi,

These queries are executed on OrientDB v1.7.8. And the Contact table only contains 110962 rows.

1/ A query with null in where take too long to complete. It usually takes 3-6 seconds.

    select from Contact where Account is null
    select from Contact where OwnedBy is null



2/ "Select count(1) from Contact" takes 3.149 second



Any suggestion will be appreciated!

alessand...@gmail.com

unread,
Dec 24, 2015, 4:04:04 AM12/24/15
to OrientDB
Hi,
did you insert an index on the field account ?

Kind regards,
Alessandro

Hung Tran

unread,
Dec 24, 2015, 6:54:40 AM12/24/15
to OrientDB
Hi Alessandro,

No, I don't create any index on a Link property but have indices on others



Here is Contact structure




My Best,
Hung Tran
Message has been deleted

alessand...@gmail.com

unread,
Dec 24, 2015, 8:32:49 AM12/24/15
to orient-...@googlegroups.com
Hi, 
indexes do not support null values as you can see at http://orientdb.com/docs/2.1/Indexes.html#indexes-and-null-values

Try with CREATE INDEX Contact.account ON Contact (account) NOTUNIQUE_HASH_INDEX METADATA {ignoreNullValues: false}

Alessandro

Luca Garulli

unread,
Dec 24, 2015, 7:27:28 PM12/24/15
to OrientDB
If you want also to index NULL values, you should enable it:


Best Regards,

Luca Garulli
Founder & CEO


On 24 December 2015 at 21:32, <alessand...@gmail.com> wrote:
Hi, 
indexes do not support null values,

Alessandro

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hung Tran

unread,
Dec 28, 2015, 8:13:41 AM12/28/15
to OrientDB
Hi,

Thank Alessandro, it's working perfectly with NULL query, but COUNT query seems to be not working



Any help will be very appreciated!

My Best,
Hung Tran

Hung Tran

unread,
Dec 28, 2015, 8:14:44 AM12/28/15
to OrientDB
Hi,

Thank Luca, it's working perfectly with NULL query, but COUNT query seems to be not working (it took 8.85 seconds, see my photo above)

My Best,
Hung Tran
Reply all
Reply to author
Forward
0 new messages