You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Carl Trieloff <cc...@redhat.com> on 2009/02/20 15:04:11 UTC
SQL and XQuery bindings/ filters
Chenta, Jonathan,
I would be interested to know if you have any thoughts on best practices
to create well optimized bindings/selector/filter for QXuery & SQL that
can operate on the headers etc of the message that are specified using
the amqp type system.
ActiveMQ does SQL 92 & XPath
http://activemq.apache.org/selectors.html
Chenta, I would expect the first set is to get it working, then make it
fast, but am wondering what are the best practices in doing query
optimization for this use-case. I wonder if Active have done any query
optimization...
Carl.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
Re: SQL and XQuery bindings/ filters
Posted by Jonathan Robie <jo...@redhat.com>.
Are you thinking of a table that defines mappings between XDM / XML
Schema types and AMQP types, and another table doing the same for SQL?
That would certainly be extremely helpful, in the XML Exchange, I'm
treating message properties as untyped for now simply because at the
time I didn't have time to create such a table.
Or are you thinking of something that would involve coordinating the
type systems?
Jonathan
John O'Hara wrote:
> Getting the type system between SQL and XDM lined up in the AMQP spec is an
> important part to making this simple going forward.
> Would be interested in what Jonathan thinks....
> John
>
> 2009/2/20 Alan Conway <ac...@redhat.com>
>
>
>> Jonathan Robie wrote:
>>
>>
>>> Hi Carl,
>>>
>>> I think the best approach for either language is to use an implementation
>>> that prepares queries. The two languages are not terribly different in the
>>> way they handle conditions on headers.
>>>
>>> I think that reading the content of the message is the slowest part of the
>>> XML Exchange, I've roughed in code that should allow me to avoid that for
>>> queries that do not actually access the message. (If the exchange could
>>> access the message content as an istream, the query engine would do this for
>>> me; as is, I have to check this by hand).
>>>
>>> Boost provides convenience libraries that making implementing istream
>>>
>> fairly easy. It shouldn't be hard to write an istream impl that iterates
>> over message content. Take a look at
>> http://www.boost.org/doc/libs/1_38_0/libs/iostreams/doc/index.html
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project: http://qpid.apache.org
>> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>>
>>
>>
>
>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
Re: SQL and XQuery bindings/ filters
Posted by John O'Hara <jo...@gmail.com>.
Getting the type system between SQL and XDM lined up in the AMQP spec is an
important part to making this simple going forward.
Would be interested in what Jonathan thinks....
John
2009/2/20 Alan Conway <ac...@redhat.com>
> Jonathan Robie wrote:
>
>> Hi Carl,
>>
>> I think the best approach for either language is to use an implementation
>> that prepares queries. The two languages are not terribly different in the
>> way they handle conditions on headers.
>>
>> I think that reading the content of the message is the slowest part of the
>> XML Exchange, I've roughed in code that should allow me to avoid that for
>> queries that do not actually access the message. (If the exchange could
>> access the message content as an istream, the query engine would do this for
>> me; as is, I have to check this by hand).
>>
>> Boost provides convenience libraries that making implementing istream
> fairly easy. It shouldn't be hard to write an istream impl that iterates
> over message content. Take a look at
> http://www.boost.org/doc/libs/1_38_0/libs/iostreams/doc/index.html
>
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>
Re: SQL and XQuery bindings/ filters
Posted by Alan Conway <ac...@redhat.com>.
Jonathan Robie wrote:
> Hi Carl,
>
> I think the best approach for either language is to use an
> implementation that prepares queries. The two languages are not terribly
> different in the way they handle conditions on headers.
>
> I think that reading the content of the message is the slowest part of
> the XML Exchange, I've roughed in code that should allow me to avoid
> that for queries that do not actually access the message. (If the
> exchange could access the message content as an istream, the query
> engine would do this for me; as is, I have to check this by hand).
>
Boost provides convenience libraries that making implementing istream fairly
easy. It shouldn't be hard to write an istream impl that iterates over message
content. Take a look at
http://www.boost.org/doc/libs/1_38_0/libs/iostreams/doc/index.html
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
Re: SQL and XQuery bindings/ filters
Posted by Jonathan Robie <jo...@redhat.com>.
Hi Carl,
I think the best approach for either language is to use an
implementation that prepares queries. The two languages are not terribly
different in the way they handle conditions on headers.
I think that reading the content of the message is the slowest part of
the XML Exchange, I've roughed in code that should allow me to avoid
that for queries that do not actually access the message. (If the
exchange could access the message content as an istream, the query
engine would do this for me; as is, I have to check this by hand).
I suspect that querying the headers with a prepared query, without
reading message content, should be pretty fast, but that's something
we'll have to measure. I am gone most of next week (at the XQuery face
to face), I doubt that I'll have something ready to check in today, so
it may be a few weeks before I can check anything in.
Jonathan
Carl Trieloff wrote:
>
> Chenta, Jonathan,
>
> I would be interested to know if you have any thoughts on best
> practices to create well optimized bindings/selector/filter for QXuery
> & SQL that can operate on the headers etc of the message that are
> specified using the amqp type system.
> ActiveMQ does SQL 92 & XPath
> http://activemq.apache.org/selectors.html
>
> Chenta, I would expect the first set is to get it working, then make
> it fast, but am wondering what are the best practices in doing query
> optimization for this use-case. I wonder if Active have done any query
> optimization...
> Carl.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org
Re: SQL and XQuery bindings/ filters
Posted by Jonathan Robie <jo...@redhat.com>.
Carl Trieloff wrote:
> ActiveMQ does SQL 92 & XPath
> http://activemq.apache.org/selectors.html
Here's a SQL 92 example from above:
JMSType = 'car' AND color = 'blue' AND weight > 2500
In XQuery, you have to declare your external variables, so this would
come out:
declare external variable $JMSType;
declare external variable $color;
declare external variable $weight;
$JMSType = 'car' and $color = 'blue' and $weight > 2500
Hope this helps,
Jonathan
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org