Running queries on large data structure

Christoph Haas email at christoph-haas.de
Fri Aug 4 08:23:15 EDT 2006


On Friday 04 August 2006 01:39, John Machin wrote:
> Christoph Haas wrote:
> > I assume that XQuery can't to weird queries like IP ranges, or can it?
>
> That's twice now you've indicated that IP ranges are causing you some
> problems. What's the big deal?
>
> (a) If you don't have a specialised data type, just parse an IP address
> into an unsigned 32-bit integer so that you can do greater/less-than
> tests and masking easily
>
> (b) handle IP range queries just like you'd do _any_ range query
>
> Or am I missing something fundamental ?

Honestly I hadn't invested much mental energy into that yet. Telling 
whether a certain IP address or IP network is part of another IP network 
was always clear to me as a simple binary AND operation. But at a second 
thought IP ranges are trivial indeed as a numerical comparison. Thanks for 
booting my brain. :)

 Christoph



More information about the Python-list mailing list