Bug #183

project() isn't considered with index selection.

Added by Andrae Muys - almost 10 years ago. Updated over 9 years ago.

Status:In Progress Start date:
Priority:Normal Due date:
Assignee:Andrae Muys - % Done:

0%

Category:Mulgara
Target version:-
Resolution:

Description

select $p from <graph:data> where $s $p $o; uses the GSPO index which requires a full external sort of the store to extract $p. If we use GPOS we get $p without the sort.

The problem is that project() call doesn't participate in index ordering within the query optimisation.

The solution is to introduce an Annotation that allows the project to specify a preferred order. Initially supporting this Annotation with StatementStoreResolution will be sufficient to satisfy the query above. A general solution will also require supporting it with Join and Append tuples.

Associated revisions

Revision 1500
Added by Andrae Muys - almost 10 years ago

refs #183

Add a PartialOrderAnnotation to StatementStoreResolution and exploit in TuplesOperations::project() to allow
optimisation of index selection with respect to projection.

Revision 1510
Added by Andrae Muys - almost 10 years ago

refs #183

Migrate the ReresolvableResolution interface to the ReresolveAnnotation.

This clears up the dependency on class introspection for optimisation, allowing the wrapping of reresolvable
tuples without losing their ability to participate in optimisation.

Revision 1542
Added by Andrae Muys - over 9 years ago

refs #183

This double array allows us to identify which index will satisfy a desired ordering of the unbound variables,
or if we don't have the appropriate index available. Should we find an appropriate index we can avoid sorting
the resulting tuples. If the table returns -1, the sort is unavoidable, so we should default to the default
index selection to improve cache efficiency.

Revision 1558
Added by Andrae Muys - over 9 years ago

refs #183

Refactored XAStatementStoreImpl to seperate the selection of the index from the selection of the find method
on the index. This allows us to select the best valid index for a set of bound variables matching an ordering
preference for the unbound variables. This is necessary if higher level code is to avoid a sort.

Revision 1564
Added by Andrae Muys - over 9 years ago

refs #183

Passes all regression tests, untested is the actual preference based index
selection, one difficulty will be matching up the nodes with the index columns
based on index order.

Next step is to eliminate the switch statement by lifting it to a lookup table,
and writing some unit-tests for the new functionality.

Revision 1569
Added by Andrae Muys - over 9 years ago

refs #183

Added a phaseId to TripleAVLFile.Phase, to allow us to track which index a phase is being used for.

Added bind[1-4] methods to ensure findTuples parameters are matched up with the correct columns for the
relevant index.

Revision 1570
Added by Andrae Muys - over 9 years ago

refs #183

Missed updating unit-test to reflect new constructor signatures.
Updated XA11 to reflect new constructor signatures.

Revision 1593
Added by Andrae Muys - over 9 years ago

refs #183

Code cleanups.

History

Updated by Andrae Muys - almost 10 years ago

  • Status changed from New to In Progress

Updated by Andrae Muys - almost 10 years ago

(In r1500) refs #183

Add a PartialOrderAnnotation to StatementStoreResolution and exploit in TuplesOperations::project() to allow
optimisation of index selection with respect to projection.

Updated by Andrae Muys - almost 10 years ago

(In r1510) refs #183

Migrate the ReresolvableResolution interface to the ReresolveAnnotation.

This clears up the dependency on class introspection for optimisation, allowing the wrapping of reresolvable
tuples without losing their ability to participate in optimisation.

Updated by Andrae Muys - over 9 years ago

(In r1542) refs #183

This double array allows us to identify which index will satisfy a desired ordering of the unbound variables,
or if we don't have the appropriate index available. Should we find an appropriate index we can avoid sorting
the resulting tuples. If the table returns -1, the sort is unavoidable, so we should default to the default
index selection to improve cache efficiency.

Updated by Andrae Muys - over 9 years ago

(In r1558) refs #183

Refactored XAStatementStoreImpl to seperate the selection of the index from the selection of the find method
on the index. This allows us to select the best valid index for a set of bound variables matching an ordering
preference for the unbound variables. This is necessary if higher level code is to avoid a sort.

Updated by Andrae Muys - over 9 years ago

(In r1564) refs #183

Passes all regression tests, untested is the actual preference based index
selection, one difficulty will be matching up the nodes with the index columns
based on index order.

Next step is to eliminate the switch statement by lifting it to a lookup table,
and writing some unit-tests for the new functionality.

Updated by Andrae Muys - over 9 years ago

(In r1569) refs #183

Added a phaseId to TripleAVLFile.Phase, to allow us to track which index a phase is being used for.

Added bind[1-4] methods to ensure findTuples parameters are matched up with the correct columns for the
relevant index.

Updated by Andrae Muys - over 9 years ago

(In r1570) refs #183

Missed updating unit-test to reflect new constructor signatures.
Updated XA11 to reflect new constructor signatures.

Updated by Andrae Muys - over 9 years ago

(In r1593) refs #183

Code cleanups.

Also available in: Atom PDF