Re: [Metakit] multi-column sorting

2004-02-10 Thread Klaus Robert Suetterlin
I do not know if I understand the question correctly, but I'll try to help with the sorting stuff. I talk about radix sort, because JCW mentioned this in his initial post. Radix sort can also be used well on the individual columns. Just append virtual zeros to short values. If You want to sort

Re: [Metakit] multi-column sorting

2004-02-10 Thread Tom Krehbiel
Jean-Claude, An idea that may be useful in speed thing up is illustrated below. You probably are already aware of this method but here it is anyway. The method can clearly be improved but I will provide a simple example to illustrate the idea. Assumption: This example assumes that a single

[Metakit] multi-column sorting

2004-02-09 Thread Jean-Claude Wippler
Does anyone know how to do a multi-column sort, using column-wise permutations? I'm looking at ways to optimize sorting, based on the fact that MK has a column-wise data organization. The current sort does row-wise comparisons. Here's what I'm after: * take the first column, sort it, and

Re: [Metakit] multi-column sorting

2004-02-09 Thread Brian Kelley
Jean-Claude Wippler wrote: Does anyone know how to do a multi-column sort, using column-wise permutations? Is this the right approach? Thinking out loud here. A multi-column sort is really a precedence sort. You only need to sort on a secondary or tertiary key if the primary key has

Re: [Metakit] multi-column sorting a real answer

2004-02-09 Thread Brian Kelley
How about another stupid answer. Suppose you have N perumation columns with M entries. Each permutation column contains the row's order if that column was the sort column. One caveat, you will need to have identical values have the same perumation order. In either case Form an integer for

Re: [Metakit] multi-column sorting

2004-02-09 Thread Jean-Claude Wippler
Brian Kelley wrote: Jean-Claude Wippler wrote: Does anyone know how to do a multi-column sort, using column-wise permutations? Is this the right approach? Thinking out loud here. A multi-column sort is really a precedence sort. You only need to sort on a secondary or tertiary key if the

Re: [Metakit] multi-column sorting

2004-02-09 Thread Tom Krehbiel
Jean-Claude, ...snip... To give an example - to sort on col 2, 4 reverse, and then 3 could be done using something like this: m2 = sortmap(col[2]) m3 = sortmap(col[3]) m4 = sortmap(col[4]) result = view.remap(m3.remap(reverse(m4)).remap(m2)) (with partial use, i.e. when fetching