I would like to partition an existing splayed table, st, by date. The
table is very large and has many dates. Is there a better way to do
this besides the following?
part_for:{[d; st]
t: delete date from select from st where date=d;
t: update sym:p#asc sym from t; h: sv :dir,($string d),table`;
h set t;};
{[d;t].Q.dpft[:.;d;sym;delete date from select from t where date=d]}each datesit also enumerates symbol columns (which you might already have enumerated anyway)and it takes into account par.txtbut otherwise it is about the sameRegards, AttilaOn 16 Dec 2009, at 01:14, michael.plumlee wrote:> I would like to partition an existing splayed table, st, by date. The> table is very large and has many dates. Is there a better way to do> this besides the following?> > part_for:{[d; st]> t: delete date from select from st where date=d;> t: update sym:p#asc sym from t;\> h: sv :dir,($string d),table`;> h set t;};> > part_for[;st] each dates;> > Thanks> > –> > Submitted via Google Groups
Thanks, that is useful to know.What if I would like to take an in memory table and add to an existingdate partitioned splayed table which is parted by sym? The othermethods just create new partitioned tables.On Dec 16, 3:05?am, Attila Vrabecz <attila.vrab…> wrote:> {[d;t].Q.dpft[:.;d;sym;delete date from select from t where date=d]}each dates>> it also enumerates symbol columns (which you might already have enumerated anyway)> and it takes into account par.txt> but otherwise it is about the same>> Regards,> ? Attila> On 16 Dec 2009, at 01:14, michael.plumlee wrote:>> > I would like to partition an existing splayed table, st, by date. The> > table is very large and has many dates. Is there a better way to do> > this besides the following?>> > ? ?part_for:{[d; st]> > ? ? ? ?t: delete date from select from st where date=d;> > ? ? ? ?t: update sym:p#asc sym from t;> > ? ? ? ?h: sv :dir,($string d),table`;> > ? ? ? ?h set t;};>> > ? ?part_for[;st] each dates;>> > Thanks>> > –>> >
what you can do is append to every column on disk
and then reorder every column by sym
only one column and the indices to order it has to be in memory at the =
same time
and finally don’t forget to put the `p# on sym
Regards,
Attila
On 16 Dec 2009, at 19:37, michael.plumlee wrote:
> Thanks, that is useful to know.
>
> What if I would like to take an in memory table and add to an existing
> date partitioned splayed table which is parted by sym? The other
> methods just create new partitioned tables.
>
> On Dec 16, 3:05 am, Attila Vrabecz <attila.vrab…> wrote: >> {[d;t].Q.dpft[:.;d;sym;delete date from select from t where = date=d]}each dates >> >> it also enumerates symbol columns (which you might already have = enumerated anyway) >> and it takes into account par.txt >> but otherwise it is about the same >> >> Regards, >> Attila >> On 16 Dec 2009, at 01:14, michael.plumlee wrote: >> >>> I would like to partition an existing splayed table, st, by date. = The >>> table is very large and has many dates. Is there a better way to do >>> this besides the following? >> >>> part_for:{[d; st] >>> t: delete date from select from st where date=d; >>> t: update sym:p#asc sym from t;<br>>>> h: sv :dir,($string d),table`; >>> h set t;}; >> >>> part_for[;st] each dates; >> >>> Thanks >> >>> – >> >>> You received this message because you are subscribed to the Google = Groups “Kdb+ Personal Developers” group. >>> To post to this group, send email to = personal-kdbplus@googlegroups.com. >>> To unsubscribe from this group, send email to = personal-kdbplus+unsubscribe@googlegroups.com. >>> For more options, visit this group = athttp://groups.google.com/group/personal-kdbplus?hl=en. > > – > > You received this message because you are subscribed to the Google = Groups “Kdb+ Personal Developers” group. > To post to this group, send email to = personal-kdbplus@googlegroups.com. > To unsubscribe from this group, send email to = personal-kdbplus+unsubscribe@googlegroups.com. > For more options, visit this group at = http://groups.google.com/group/personal-kdbplus?hl=en. > >