RE: Fw: RE: FW: DN-FO-09: 15.1.11 fn:distinct-values

> > The WGs considered your request in the meeting on 9/16/2003 and 
> > decided not to change the semantics of fn:distinct-values to return 
> > values in order of first appearance.  The feeling was that such a 
> > constraint would inhibit optimization of this function.
> 
> Thank you very much for considering this request.
> 
> I am very much concerned about the way the WG seems to take 
> its decisions:
> 
>  1. Based on "feeling".

Hey, go easy, Dimitre! When a vote is taken at a meeting, many people might
be voting the same way for different reasons. Ashok has the unenviable task
of trying to sum up the sense of the meeting that made the decision, and all
he's saying is that most of the arguments by people who won the day were
based on optimization considerations.
> 
>  2. Is the above reply  a statement that there do not exist efficient 
>     algorithms for returning the distinct values of a 
> sequence in order of
> 
>     first appearance
>  or
>    is this an expression of a belief or feeling or lack of 
> information?

I think it has more to do with the fact that a significant number of members
of the Query working group are producing implementations that store their
data in relational databases, and relational databases have storage
structures that are optimized for producing unordered results. You may not
like that reasoning, but these guys pay their subs and get a vote.
> 
> Another observation is that the definition of 
> fn:distinct-values() in the current WD is overspecified, 
> which unnecessarily narrows the types of the first argument 
> of the function.
> 
> The unnecessary condition is the requirement that "The type 
> must have a total order".
> 
> A total order relation is in fact not necessary condition for 
> solving the problem of finding unique values of a sequence.

We did in fact change the spec so that there is no longer a rule that all
the items must be comparable (non-comparable items are now treated as
distinct). I'm not sure off-hand if the total ordering rule has gone too,
but it certainly should go.

Michael Kay

Received on Wednesday, 24 September 2003 18:22:23 UTC