You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2007/10/04 13:17:28 UTC
[Db-derby Wiki] Update of "OLAPRowNumber" by ThomasNielsen
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.
The following page has been changed by ThomasNielsen:
http://wiki.apache.org/db-derby/OLAPRowNumber
------------------------------------------------------------------------------
== Proposed Changes ==
''DRAFT''
- Conceptually the steps needed are
+ The steps we propose taking are
* The new syntax must be added to the SQL grammar
- * Each node in the query tree should be decorated with a {{{RowNumberNode()}}}
- * A row number should be assigned to the Derby {{{ResultSet}}} after (during?) ordering/grouping.
+ * A {{{RowNumberColumnNode}}} is added to the querytree for every instance of {{{the ROW_NUMBER()}}} in the query during compilation
+ * During code generation in {{{ResultColumnList.generateCore()}}} we trap instances of {{{RowNumberColumnNode}}} in the querytree and generate code to virtually invoke {{{BaseActivation.getSetRowNumberValue()}}}
+ * During execution of the generated code {{{BaseActivation.getSetRowNumberValue()}}} handles the incrementation and caching of rownumber values based for a given column.
+ * Optimization should cause the execution to stop once possible {{{WHERE}}} clauses are satisfied.