Re: temp tables and serial columns
Posted in 2007
Jonathan Leffler schrieb: > Bill Hamilton wrote: >> But that does not answer the question: "Is there a practical use for a >> serial column in a temp table?" >> Perhaps there are times when you don't want to use a sequence >> generator and the serial could be useful? > > For a long time, there were no sequences in IDS - just SERIAL columns. > > Yes, I regard a SERIAL column in a temp table as occasionally useful. > > It would be more useful if you were permitted to include ORDER BY with > the SELECT statement that inserts data into the table - it would give > you a simple numeric key that orders the data. so true, so very, very true! For a long time now I searching for a better way to generate the text for storage options of fragmented indexes. I think the only way to do this needs a table with a serial and a copy of the primary key _in sorted order_, as one needs to pick up the values of the primary key where serial is equal to 1, nrows/F * n n=1..(F-1), nrows (F is the number of indexfragments you want to have) One has to know the values of aequidistant primary keys in the table to have the values for the intervals, whenever an index has to be (re-) fragmented. Anyone out there, who knows a better way to do this? dic_k [ ... snip ... ] -- Richard Kofler SOLID STATE EDV Dienstleistungen GmbH Vienna/Austria/Europe