You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Eranda Sooriyabandara <07...@gmail.com> on 2009/09/20 20:03:49 UTC

Need a help on DERBY-3892

Hi all,Last few days I try to understand the code in method prepMinion() in
class GenericStatement to get an idea about the query plan to optimize the
query plan. But It is hard me to understand the code. If you can send me
a link or something helpful facts to understanding how the query
works(macroscopic view) to study about it will be a great help for me.
I use the debugging tool to see how the query plan works using a break point
at prepMinion in GenericStatement class but when I query using
>>prepare st1 as 'select col1 from table1';
>>execute st1;
I did not find a break at the point where I set the break point.
Is there any thing I missed here or I need to aware of??
Thanks
Eranda

Re: Need a help on DERBY-3892

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Bryan Pendleton <bp...@amberpoint.com> writes:

> The other question you're asking is: how to reliably cause
> GenericStatement.prepMinion to get run, in order to set a
> breakpoint there and step through the code.
>
> I'm not sure how to do this. Sometimes stepping through this
> code is really tricky, because you only get one chance to do it,
> the first time the statement is compiled (after that, the statement
> is already compiled, and is found in the cache, and so it doesn't
> get re-compiled).

Disabling the statement cache probably helps. Then the statement is
compiled each time Connection.prepareStatement() is called.

  derby.language.statementCacheSize=0

This property has not been documented yet (DERBY-4280).

-- 
Knut Anders

Re: Need a help on DERBY-3892

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Hi Eranda,

I'm afraid I don't know of any good high-level documentation
about this part of the system.

I think maybe this is a good place for us to start; we should
start by trying to improve the documentation about how this
part of the system behaves.

The Derby wiki is a good place to store this documentation, so
we should try to write some information there.

I think that we should document two things:

1) The statement cache: what it is, what it does, how it is
    implemented, etc.

2) GenericStatement.prepMinion: what it does, and how it works.
    This information is probably better recorded as javadoc.

The other question you're asking is: how to reliably cause
GenericStatement.prepMinion to get run, in order to set a
breakpoint there and step through the code.

I'm not sure how to do this. Sometimes stepping through this
code is really tricky, because you only get one chance to do it,
the first time the statement is compiled (after that, the statement
is already compiled, and is found in the cache, and so it doesn't
get re-compiled).

I'll try to work out a script that reliably lets me step through
this code and then I'll let you know.

bryan