Re: sample query involving disjunction

On Sun, Sep 19, 2004 at 02:07:05 +0100, Andy Seaborne wrote:
> >Using a capability for multiple queries in the same request
> >that would simply be
> >
> >SELECT ?X
> >WHERE  {?X a :Person . ?X a :DogOwner}
> >
> >SELECT ?X
> >WHERE  {?X a :Person . ?X :hasPet ?Y . ?Y a :Dog}
> >
> >
> >returning
> >(:Eddie) a q:Answer. 
> >(:Mitch) a q:Answer. 
> >
> >
> 
> Jos - right! - this is the way I have implemented it, like "UNION ALL" in
> SQL (no duplicate suppression).
> 
> For a query of the form of "A & ( B | C )" (shared pattern A) some
> combined query can do better than the expansion "(A&B) | (A&C)" but this
> is in the realm of compiler techniques and it would be quite
> easy to spot common patterns across the two queries because they have to
> use the same variable names.
> 
> In the local case, one query or two is, maybe, not significant.  Across
> the web it is significant: either the client needs to send two parallel
> requests (client libraries raely do provide async I/O by default) or incur
> additional latency by serialised issuing of the requests.  And the query
> engine isn't given information it might use to optimize with.

Not neccesarily, the client can issue the two queries in one request, for
eg. seperated by ;'s.

- Steve

Received on Monday, 20 September 2004 07:39:43 UTC