Hi Joe,

The trouble with trying to do a binary search in this context is that we
need to be cognizant of the datatypes of the values we're trying to match.
So, if the key has two fields (a decimal and a string, say) then, in order
to match, two values have to be equal in both value spaces, as schema
defines them.  Since binary search relies on order, it's not at all obvious
how you'd apply it in this context.

We could use a Hashtable, I guess, if we made sure the .equals method was
overloaded appropriately.  But this might be a tit tricky, since we don't
have objects yet that represent all the various value spaces; we have to
use String representations and the knowledge of various DatatypeValidators.

So as I say, this wouldn't be trivial to do efficiently and right, at least
with current infrastructure...

Guess we'll see how many more requests like this we get; that'll help judge
how much the world actually cares about this...

Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]




|---------+---------------------------->
|         |           Joseph           |
|         |           Kesselman/Watson/|
|         |           IBM@IBMUS        |
|         |                            |
|         |           11/15/2002 12:37 |
|         |           PM               |
|         |           Please respond to|
|         |           xerces-j-dev     |
|         |                            |
|---------+---------------------------->
  
>---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                                         |
  |       To:       [EMAIL PROTECTED]                                        
                                                         |
  |       cc:                                                                          
                                                         |
  |       Subject:  Re: Schema key and unique contraints VERY slow                     
                                                         |
  |                                                                                    
                                                         |
  |                                                                                    
                                                         |
  
>---------------------------------------------------------------------------------------------------------------------------------------------|



On Friday, 11/15/2002 at 11:57 EST, [EMAIL PROTECTED] wrote:
> No; it iterates through all the other key values it's seen so far (from
the
> same constraint).

Sounds like this is begging for a hashtable, or for maintaining a sorted
list and doing a binary search through it, or some other less-than-linear
search table.

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to