On Wed, Jun 18, 2008 at 06:28:17PM +0100, Sam Mason wrote:
On Wed, Jun 18, 2008 at 07:13:58PM +0200, Niels Nes wrote:
On Wed, Jun 18, 2008 at 05:28:29PM +0100, Sam Mason wrote:
OK, how much of a change to the code do you think it would be to remove this behavior? I'm reasonably proficient in C, the thing that tends to take time is learning the structure of a new codebase.
Depends on how you want to solve it. Current code uses a hash solution a clustered hash or sorted solution would work better (less random io).
As in some sort of hash structure is persistently maintained? Its basically a column which stores key values, which is accessed using an in memory hash table.
The code for schema altering sql statements is layered as follows sql parser, semantic checks,generate a tree of the needed 'mal' instructions, optimizers, generate mal.
sounds like a bit of learning! Indeed a sql compiler is usualy a bit of learning ;-).
So adaption of the code in sql_schema/sql_updates would be needed possibly with a new index structure to support the more advanced key checks (clusters/ordered index).
When you say "more advanced key checks" do you pretty much mean anything more than equality? Clusters could support more than equality. But for the primary key checks I just mean a more advanced (faster) way of checking unique ness.
This is not a task some one new at MonetDB should start at. There are better 'introductionary' tasks by which you could slowly learn the system. One such task would be the addition of new functions, ie c-functions which can be called from sql. From the feature requests for example I know we would like more advanced time/date output format functions.
Oracle and PG both provide a to_char function[1] that I could try implementing a subset of. I don't really like the formatting string of to_char, I prefer C's strftime more, but it could be a good compatible start.
We do support strftime for 'type date', but we would like to support it for time and timestamp as well. See the current implementation in MonetDB5/src/modules/adt/mtime.mx as a starting point. The functionality can be added to sql using sql/src/sql/date.sql. Niels -- Niels Nes, Centre for Mathematics and Computer Science (CWI) Kruislaan 413, 1098 SJ Amsterdam, The Netherlands room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312 url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl