Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Problem with limit and compound indexes #1409

federicoemartinez opened this issue Mar 25, 2013 · 4 comments
Assignees
Labels
Milestone

Comments

@federicoemartinez
Copy link

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).

@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 milestones: 2.2, 2.1 Mar 14, 2015
@lvca lvca removed the bug label Apr 8, 2015
@federicoemartinez
Copy link
Author

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

@lvca
Copy link
Member

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?

@federicoemartinez
Copy link
Author

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.

@federicoemartinez
Copy link
Author

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
Labels
Development

No branches or pull requests

4 participants