From 3fad738c13c12f0be3cf4e453b559427e7f420d9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 9 May 2008 03:36:30 +0000 Subject: Clustered index selection fixes. --- src/main/java/com/amazon/carbonado/qe/IndexedQueryExecutor.java | 2 +- src/main/java/com/amazon/carbonado/qe/OrderingScore.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/qe') diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryExecutor.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryExecutor.java index 0599b00..8954ed6 100644 --- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryExecutor.java +++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryExecutor.java @@ -310,7 +310,7 @@ public class IndexedQueryExecutor extends AbstractQueryExecu indent(app, indentLevel); app.append("...covering filter: "); mCoveringFilter.appendTo(app, values); - + newline(app); } return true; } diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java index 9bfcde1..32f6936 100644 --- a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java +++ b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java @@ -526,7 +526,11 @@ public class OrderingScore { // Choose index with any handled properties over the one with // neither handled nor remainder properties. if (Double.isNaN(firstRatio)) { - if (!Double.isNaN(otherRatio)) { + if (Double.isNaN(otherRatio)) { + // Order checks are not really applicable. The query does + // not have an ordering applied to it. + return 0; + } else { return 1; } } else if (Double.isNaN(otherRatio)) { -- cgit v1.2.3