Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implement index optimization on SELECT queries
new executor
- Loading branch information
1 parent
b5dc089
commit 4de5cb9
Showing
18 changed files
with
846 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
core/src/main/java/com/orientechnologies/orient/core/sql/executor/IndexCondPair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,42 @@ | |||
package com.orientechnologies.orient.core.sql.executor; | |||
|
|||
import com.orientechnologies.orient.core.sql.parser.OAndBlock; | |||
import com.orientechnologies.orient.core.sql.parser.OBinaryCondition; | |||
|
|||
/** | |||
* For internal use. | |||
* It is used to keep info about an index range search, | |||
* where the main condition has the lower bound and the additional condition has the upper bound on last field only | |||
*/ | |||
class IndexCondPair { | |||
|
|||
OAndBlock mainCondition; | |||
OBinaryCondition additionalRange; | |||
|
|||
public IndexCondPair(OAndBlock keyCondition, OBinaryCondition additionalRangeCondition) { | |||
this.mainCondition = keyCondition; | |||
this.additionalRange = additionalRangeCondition; | |||
} | |||
|
|||
@Override public boolean equals(Object o) { | |||
if (this == o) | |||
return true; | |||
if (o == null || getClass() != o.getClass()) | |||
return false; | |||
|
|||
IndexCondPair that = (IndexCondPair) o; | |||
|
|||
if (mainCondition != null ? !mainCondition.equals(that.mainCondition) : that.mainCondition != null) | |||
return false; | |||
if (additionalRange != null ? !additionalRange.equals(that.additionalRange) : that.additionalRange != null) | |||
return false; | |||
|
|||
return true; | |||
} | |||
|
|||
@Override public int hashCode() { | |||
int result = mainCondition != null ? mainCondition.hashCode() : 0; | |||
result = 31 * result + (additionalRange != null ? additionalRange.hashCode() : 0); | |||
return result; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.