[Mulgara-general] ITQL doubts

Paul Gearon gearon at ieee.org
Wed Feb 14 09:46:27 CST 2007


On Feb 13, 2007, at 10:07 PM, Andrae Muys wrote:
> On 14/02/2007, at 11:39 AM, 12470 at ufp.pt wrote:
<snip/>
>> select $event $session from <rmi://localhost/server1#events>
>> where $e <myrdf:event> $event and ($e <myrdf:event> 'xyz') and ($e  
>> <myrdf:session_id> $session);

<snip/>

> where $event <mulgara:is> 'xyz' and
>       $e <myrdf:event> $event and
>       $e <myrdf:session_id> $session;

<snip/>

>> Can this query be optimized?
>
> I'm not sure.  Check how many results are returned from $e  
> <myrdf:event> 'xyz'; if it's only 1 then both the original query  
> and my suggested query should run in the same time.  But unless it  
> is a large number - in which case you probably intend it to work  
> the way it does and the simplified query won't give you the result  
> you want - the difference should be negligible.  It would be useful  
> to find out why you're not seeing the performance you expect.  One  
> issue may be if you are including connection establishment in your  
> measurements, mulgara currently uses RMI with a resulting high  
> connection cost to establish a session.  What sort of times are you  
> seeing?

I'm ill today, so not thinking clearly, but I'm just wondering which  
of the constraints from the original query was being resolved first?   
I know we want to resolve ($e <myrdf:event> 'xyz') first, but could  
we actually be resolving ($e <myrdf:event> $event) first instead?   
(Andrae, you rewrote this.  Can you please confirm?)

If it was getting resolution in the wrong order, then that would  
explain a slow query, and Andrae's pre-binding of $event will speed  
it up.  Otherwise, the slow response may be in transferring a large  
amount of data to the client end.  Since this is streamed, then maybe  
there's some code in there that is trying to get a complete result  
before proceeding?


Paul


More information about the Mulgara-general mailing list