On Mon, Jul 2, 2012 at 1:14 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> Your argument is for SQLite to allow users to implement their own affinities 
> (datatypes ?) must like SQLite3 allows users to implement collation 
> algorithms and functions.  But I don't think you're going to get something as 
> rarely used in SQLite4 when it's specially designed to be tiny and light.  
> SQLite stays that way by refusing to add rarely-used facilities.

No simple user-defined type is likely to allow for user-defined
literals for user-defined types.

What does matter, I think, is how commonly used some type might be.
IP addresses are very commonly used in relational DBs.

> But I still question whether you're engaged in premature optimization.  Would 
> things really be that much slower if you stored IPv4/6 as Higits ?  IPv4 
> stored as hex is readable, sortable, can be transferred from place to place 
> as an 8 character string and works perfectly with the standard distribution 
> of SQLite3 with no changes.  Implement conversion in- and out- functions 
> either as SQLite functions or in your programming language, as suits you.  
> You're concerned about the performance you lose by storing 10 octet strings 
> instead of having a custom type ?  Possibly if you're running a major ISP or 
> doing packet analysis and logging for one.  But you wouldn't be using SQLite 
> to do that anyway, you'd be running something with built-in caching and 
> redundancy.

Hex is not good enough for CIDR blocks (i.e., bit strings of length <=
sizeof(address-type)), unless you encode the bit string length mod 8
into the last byte, with appropriate zero-bit padding.  Then it's good
enough, but hardly user-friendly.

IP addresses are useful in databases that store configuration
information.  NICs, for example, must have such databases, and any
sufficiently large network is going to need one too.  I've seen a
number of home-grown Moira-like databases, and I maintained one called
UName*It (which used UniSQL/X underneath).  Any organization with
home-grown DNS management is going to need this, and any open source
and/or commercial DNS management tools will need this under the hood.
IP addresses are really quite common in databases.  This is why
Postgres has native IP address support.

Nico
--
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to