Hi Phil (cc'ed to the list),
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
The same applies to the estimation of query results: the costs and size of single XQuery results can vary a lot, as a single result node can span several MB, while a single atomic item may just take a few bytes.
Hope this helps (at least a little), Christian ___________________________
Hi Christian - is there a way to perform a low-cost (very fast) estimation of the amount of time a particular query would take without actually executing the query? In a server environment this is extremely useful. I would like to be able to rapidly check that queries will not be issued which exceed a certain execution time (roughly or even very roughly - e.g. on the order of a second vs. on the order of 100 or 1000 seconds.) Since my queries are going to be dynamically generated based on user supplied parameters this is an issue. A related issue is estimating the number of nodes retrieved as a result of a given query (again without actually executing it.) The estimation would not have to be very exact.
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.comwrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution time before the query is cleanly aborted (in "wall clock time")? This would be in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options is mentioned server wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query.
Jan
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün <christian.gruen@gmail.com
wrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution time before the query is cleanly aborted (in "wall clock time")? This would be in a client/server context.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi,
this timeout is not server specific, so you can set it for each client separately. The easiest way is set timeout, run query, set timeout back.
-- Andreas
Am 24.02.2011 um 07:32 schrieb Jan Vlčinský (CAD):
Phil At http://docs.basex.org/wiki/Options#Server_options is mentioned server wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query.
Jan
2011/2/24 NewIntellectual newintellectual@gmail.com On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote: as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution time before the query is cleanly aborted (in "wall clock time")? This would be in a client/server context.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution time before the query is cleanly aborted (in "wall clock time")? This would be in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options%C2%A0is mentioned server wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query. Jan
....exactly; this option will do exactly what you need.
Thanks, Christian
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
Another question is - is there any way to set timeout when using REST interface? Jan
2011/2/24 Christian Grün christian.gruen@gmail.com
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution
time
before the query is cleanly aborted (in "wall clock time")? This would
be
in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options is mentioned server wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query. Jan
....exactly; this option will do exactly what you need.
Thanks, Christian
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
Another question is - is there any way to set timeout when using REST interface? Jan
As our JAX-RX (REST) interface communicates with a BaseX server instance in the background, you can as well set the TIMEOUT option to limit your query execution time.
Hope this helps, Christian
2011/2/24 Christian Grün christian.gruen@gmail.com
I see. Can you remark on how hard it might be to specify a parameter in the appropriate query methods which would designate a maximum execution time before the query is cleanly aborted (in "wall clock time")? This would be in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options%C2%A0is mentioned server wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query. Jan
....exactly; this option will do exactly what you need.
Thanks, Christian
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has some notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
OK, I understand, that REST allows to perform the (SET) command, but to use it with a query, I have to send the query in another, following, request. Will this second request keep enough context at the server side to know, it shall use that timeout? As REST is (or shall be) stateless, no context shall be assumed, so the timeout shall be forgotten. Or is there an option to send query AND
Jan
2011/2/24 Christian Grün christian.gruen@gmail.com
Another question is - is there any way to set timeout when using REST interface? Jan
As our JAX-RX (REST) interface communicates with a BaseX server instance in the background, you can as well set the TIMEOUT option to limit your query execution time.
Hope this helps, Christian
2011/2/24 Christian Grün christian.gruen@gmail.com
I see. Can you remark on how hard it might be to specify a parameter
in
the appropriate query methods which would designate a maximum
execution
time before the query is cleanly aborted (in "wall clock time")? This
would
be in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options is mentioned
server
wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query. Jan
....exactly; this option will do exactly what you need.
Thanks, Christian
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote:
as far as I can judge, XQuery expressions are too heterogeneous to provide realistic cost estimations. While our query compiler has
some
notion of "costs", those values are all relative, and used to select the (presumably) cheapest query plan or index access.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
OK, I understand, that REST allows to perform the (SET) command, but to use it with a query, I have to send the query in another, following, request. Will this second request keep enough context at the server side to know, it shall use that timeout? As REST is (or shall be) stateless, no context shall be assumed, so the timeout shall be forgotten. Or is there an option to send query AND the set command in one request?
Jan
PS: Sorry for previous incomplete e-mail
2011/2/24 Jan Vlčinský (CAD) jan.vlcinsky@cad-programs.com
Jan
2011/2/24 Christian Grün christian.gruen@gmail.com
Another question is - is there any way to set timeout when using REST interface? Jan
As our JAX-RX (REST) interface communicates with a BaseX server instance in the background, you can as well set the TIMEOUT option to limit your query execution time.
Hope this helps, Christian
2011/2/24 Christian Grün christian.gruen@gmail.com
I see. Can you remark on how hard it might be to specify a parameter
in
the appropriate query methods which would designate a maximum
execution
time before the query is cleanly aborted (in "wall clock time")? This
would
be in a client/server context.
Phil At http://docs.basex.org/wiki/Options#Server_options is mentioned
server
wide option TIMEOUT, which can limit time for query execution. I wonder, if there is any way to specify this per query. Jan
....exactly; this option will do exactly what you need.
Thanks, Christian
2011/2/24 NewIntellectual newintellectual@gmail.com
On Wed, Feb 23, 2011 at 8:20 PM, Christian Grün christian.gruen@gmail.com wrote: > > as far as I can judge, XQuery expressions are too heterogeneous to > provide realistic cost estimations. While our query compiler has
some
> notion of "costs", those values are all relative, and used to
select
> the (presumably) cheapest query plan or index access.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
-- Ing. Jan Vlčinský CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
-- *Ing. Jan Vlčinský* CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
OK, I understand, that REST allows to perform the (SET) command, but to use it with a query, I have to send the query in another, following, request. Will this second request keep enough context at the server side to know, it shall use that timeout?
Just recently, I've thought about extending the JAX-RX Interface to allow more than a single query or command, or to allow both commands and queries; regarding the syntax, this could be easily realized for the GET method:
http://localhost:8984/basex/jax-rx/factbook?query=1&query=2 http://localhost:8984/basex/jax-rx/factbook?command=set+timeout+1&query=...
On the other hand, I haven't decided yet how to best realize it for the POST method without giving up compatibility. One solution could be to introduce alternative "request" root elements:
<request xmlns="http://jax-rx.sourceforge.net"> <command> <text>set timeout 1</text> </command> <query> <text>//name</text> <parameter name="count" value="5"/> </query> </request>
What does everyone think? Christian
basex-talk@mailman.uni-konstanz.de