Re: Exposing some getter methods and classes for TableEngine implementors

2013-02-26 Thread Noel Grandin


On 2013-02-27 01:14, Ashwin Jayaprakash wrote:


*Issue 1: *This seems alright except for the deepest join on c where 
the predicate (c.type = 'answers') _does not get pushed down_ in the 
TableFilter.getFilterCondition() for "c" where it is null.


Patches are welcome.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Exposing some getter methods and classes for TableEngine implementors

2013-02-26 Thread Ashwin Jayaprakash
I have something to add to my previous request. For a moderately complex 
query like this:

select *a*.id, *a*.age, b.id, *c*.id, *c***.type
from *a* 
  left outer join *b* on a.id = b.id
  left outer join *c* on b.id = c.id 
where *a*.age < 42 and *c*.type = 'answers'

Here, a.id, b.id, c.id are all indexed columns.

While executing this query, the database does a nested loop join of:
   a (age < 42) *[* b (b.id = current a.id) *[* c (c.id = current b.id) *]* 
*]*

*Issue 1: *This seems alright except for the deepest join on c where the 
predicate (c.type = 'answers') *does not get pushed down* in the 
TableFilter.getFilterCondition() for "c" where it is null.

*Issue 2:* The second thing is more of an enhancement request where the *
TableFilter.fullCondition* does not have a *getter method*. It would be 
nice if we had one for that. If this were available then issue 1 could be 
somewhat alleviated if we had visibility into the overall/full condition. 
This way TableEngine implementors can do some early optimizations.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Exposing some getter methods and classes for TableEngine implementors

2013-02-25 Thread Ashwin Jayaprakash
Hi, this is a followup to a request I made a few days ago - "Get methods on 
limitExpr, offsetExpr, distinct in 
...". 
I'm very pleased to say that I got instant resolution on that, Thanks Noel 
Grandin!

*For custom implementations of TableEngine and related Table/Index classes:* 

   - Delete:
  - This normally translates to a fetch cursor (with or without index) 
  and then call Table.removeRow(xx) on the filtered rows
   - Update:
   - An UPDATE will translate to a fetch cursor and call 
  Table.updateRows(xx) with the affected rows
  - This then translates eventually to the default Table.removeRow(xx) 
  and Table.addRow(xx) behavior for each row
   - Some cases can exploit early optimizations on UPDATE and DELETE 
   statements
  - This "may" be done by *short circuiting* these fetch-cursor and 
  then delete+add steps in some cases by snooping into the *
  session.getCurrentCommand()*
  - To accomplish this I feel that the following minor enhancements 
  need to be done
  
*Enhancement request:*
1) org.h2.command.CommandContainer:
  Make class public
  Add getter for "prepared"

2) org.h2.command.dml.Update:
  Add getter for "condition"
  Add getter for "tableFilter"
  Add getter for "columns"
  Add getter for "expressionMap"

3)  org.h2.command.dml.Delete
  Add getter for "condition"
  Add getter for "tableFilter"

Hope this makes sense.

Thanks,
Ashwin.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.