Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Problem with limit and compound indexes #1409

Closed
federicoemartinez opened this Issue Mar 25, 2013 · 4 comments

Comments

Projects
None yet
4 participants

I'm using the 1.4.0-SNAPSHOT. In the console I have the following query:

select * from ExampleEdgeVersion where versioned_edge = #17:1305 and (end_date is null or end_date > 1364231981454) and begin_date <= 1364231981454

that query gives me one record. However if I add a "limit 1" it gives me nothing. Looking at the explain I get:

explain select * from ExampleEdgeVersion where versioned_edge = #17:1305 and (end_date is null or end_date > 1364231981454) and begin_date <= 1364231981454
Profiled command '{current:#18:4,compositeIndexUsed:1,indexReads:3,documentAnalyzedCompatibleClass:3,involvedIndexes:[1],elapsed:0.00203451,resultType:collection,resultSize:1}' in 0.003000 sec(s):
{
"@type":"d","@Version":0,"current":"#18:4","compositeIndexUsed":1,"indexReads":3,"documentAnalyzedCompatibleClass":3,"involvedIndexes":["EdgeVersion_versioned_edge_end_date_idx"],"elapsed":0.00203451,"resultType":"collection","resultSize":1,"@fieldtypes":"compositeIndexUsed=l,indexReads=l,documentAnalyzedCompatibleClass=l,elapsed=f"
}

explain select * from ExampleEdgeVersion where versioned_edge = #17:1305 and (end_date is null or end_date > 1364231981454) and begin_date <= 1364231981454 limit 1

Profiled command '{current:#18:2,compositeIndexUsed:1,indexReads:1,documentAnalyzedCompatibleClass:1,involvedIndexes:[1],elapsed:0.001042662,resultType:collection,resultSize:0}' in 0.003000 sec(s):
{
"@type":"d","@Version":0,"current":"#18:2","compositeIndexUsed":1,"indexReads":1,"documentAnalyzedCompatibleClass":1,"involvedIndexes":["EdgeVersion_versioned_edge_end_date_idx"],"elapsed":0.001042662,"resultType":"collection","resultSize":0,"@fieldtypes":"compositeIndexUsed=l,indexReads=l,documentAnalyzedCompatibleClass=l,elapsed=f"
}

EdgeVersion_versioned_edge_end_date_idx is an automatic index over the columns versioned_edge (type link) and end_date (type float).

@laa laa was assigned by lvca Oct 4, 2014

@lvca lvca added this to the 2.1 milestone Oct 4, 2014

@lvca lvca added the bug label Oct 4, 2014

@lvca lvca modified the milestone: 2.2, 2.1 Mar 14, 2015

@lvca lvca removed the bug label Apr 8, 2015

Why has the bug label been removed? It does look like a bug to me

Owner

lvca commented Sep 22, 2015

Sorry, dunno why I removed the label, by reading the description is a bug. Any chance to try it with a recent version of OrientDB? Let's say 2.1.2?

I haven't tried again, to be honest it was a deal-breaker by that time. We have decided to test orientdb again. I'll let you know if this works now.

@prjhub prjhub removed the waiting reply label Sep 23, 2015

@lvca lvca added the waiting reply label Sep 23, 2015

it seems it's working now. I'm closing this issue.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment