db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madushanka Fonseka <madushan...@gmail.com>
Subject Re: Execution Call Hierarchy - Derby SQL
Date Sun, 18 Aug 2013 17:01:33 GMT
Hi Bryan,

Thanks a lot,

to execute a query like

select e.id,d.name from employees e, departments d
                where e.salary> 50000

we need byte codes,

can u explain that call stack and how byte codes get connected ?

Madushanka



On Sun, Aug 18, 2013 at 9:48 PM, Bryan Pendleton <bpendleton.derby@gmail.com
> wrote:

> > I cant figure out how the generated byte code classes get hooked up with
> these calls
>
> I don't think this particular call stack is very much
> concerned with generated byte code classes.
>
> At this point in the processing of the SELECT query,
> the execution engine is associating the logical tablenames
> from your query with the physical files that hold the
> actual data.
>
> So if the query is:
>
>         select e.id,d.name from employees e, departments d
>                 where e.dept_id = d.id
>
> then what we're doing in the stack trace that you posted
> is to translate the 'employees' table into something like
>
>         c:\temp\db\seg0\c2e1.dat
>
> and translate the 'departments' table into something like
>
>         c:\temp\db\seg0\c3b1.dat
>
> and then we open those files and let the storage subsystem
> do its initialization to be ready to read from those tables.
>
> This process is called "binding" the tables, so that's why
> you see the word "bind" in many of those method names.
>
> thanks,
>
> bryan
>
>
> On 8/18/2013 8:04 AM, Madushanka Fonseka wrote:
>
>> Hi,
>>
>> I have been working on Apache derby in order to make it an option to
>> query vague data (using fuzzy models) not only crisp data.
>>
>> This is the progress I made so far.
>>
>> * Stdied Apache architecture, its modules : Query Parser, Excution,
>> Store, JDBC Layer etc.
>> * Prep a fuzzy query grammar file
>> * Studied Apache derby byte code generation machinery
>>
>> I figured out the call hierarchy that happens on a "SELECT" query.
>>
>> at org.apache.derby.impl.store.**raw.xact.Xact.setActiveState(**
>> Xact.java:1864)
>> at org.apache.derby.impl.store.**raw.xact.Xact.openContainer(**
>> Xact.java:1342)
>> at org.apache.derby.impl.store.**access.conglomerate.**
>> OpenConglomerate.init(**OpenConglomerate.java:910)
>> at org.apache.derby.impl.store.**access.heap.Heap.open(Heap.**java:688)
>> at org.apache.derby.impl.store.**access.RAMTransaction.**
>> openConglomerate(**RAMTransaction.java:464)
>> at org.apache.derby.impl.store.**access.RAMTransaction.**
>> openConglomerate(**RAMTransaction.java:1287)
>> at org.apache.derby.impl.sql.**catalog.DataDictionaryImpl.**
>> getDescriptorViaIndexMinion(**DataDictionaryImpl.java:9470)
>> at org.apache.derby.impl.sql.**catalog.DataDictionaryImpl.**
>> getDescriptorViaIndex(**DataDictionaryImpl.java:9426)
>> at org.apache.derby.impl.sql.**catalog.DataDictionaryImpl.**
>> locateSchemaRow(**DataDictionaryImpl.java:1817)
>> at org.apache.derby.impl.sql.**catalog.DataDictionaryImpl.**
>> getSchemaDescriptor(**DataDictionaryImpl.java:1684)
>> at org.apache.derby.iapi.sql.**StatementUtil.**getSchemaDescriptor(**
>> StatementUtil.java:138)
>> *at org.apache.derby.impl.sql.**compile.QueryTreeNode.**
>> getSchemaDescriptor(**QueryTreeNode.java:1066)*
>> *at org.apache.derby.impl.sql.**compile.QueryTreeNode.**
>> getSchemaDescriptor(**QueryTreeNode.java:1042)*
>> *at org.apache.derby.impl.sql.**compile.FromBaseTable.**
>> bindTableDescriptor(**FromBaseTable.java:2673)*
>> *at org.apache.derby.impl.sql.**compile.FromBaseTable.**bindNonVTITables(
>> **FromBaseTable.java:2303)*
>> *at org.apache.derby.impl.sql.**compile.FromList.bindTables(**
>> FromList.java:344)*
>> *at org.apache.derby.impl.sql.**compile.SelectNode.**
>> bindNonVTITables(SelectNode.**java:524)*
>> *at org.apache.derby.impl.sql.**compile.DMLStatementNode.**
>> bindTables(DMLStatementNode.**java:193)*
>> *at org.apache.derby.impl.sql.**compile.DMLStatementNode.bind(**
>> DMLStatementNode.java:127)*
>> *at org.apache.derby.impl.sql.**compile.CursorNode.**
>> bindStatement(CursorNode.java:**274)*
>> *at org.apache.derby.impl.sql.**GenericStatement.prepMinion(**
>> GenericStatement.java:423)*
>> *at org.apache.derby.impl.sql.**GenericStatement.prepare(**
>> GenericStatement.java:100)*
>> *at org.apache.derby.impl.sql.**conn.**GenericLanguageConnectionConte**
>> xt.prepareInternalStatement(**GenericLanguageConnectionConte**
>> xt.java:1109)*
>> *at org.apache.derby.impl.jdbc.**EmbedStatement.execute(**
>> EmbedStatement.java:685)*
>> *at org.apache.derby.impl.jdbc.**EmbedStatement.executeQuery(**
>> EmbedStatement.java:148)*
>> *at edu.uom.derby.test.Main.go(**Main.java:218)*
>>
>>
>> I know the machinery up to the bold method calls in the listing. I cant
>> figure out how the generated byte code classes get hooked up with these
>> calls along with resultset and excution factories. I would be much pleased
>> if you could help me.
>>
>> Madushanka Fonseka
>> Sn. Engineer - technology
>>
>>
>

Mime
View raw message