Re: CREATE TEMP TABLE LIKE mytable.*
Posted in 1994
At 03:32 PM 11/20/94 -0500, Walt Hultgren {rmy} wrote: }In article <3ao8hq$rv1@infmx.informix.com> proberts@informix.com (Paul Roberts) }writes: }>In article <WBpokq4b9RLH073yn@kcbbs.gen.nz> kerry@kcbbs.gen.nz (Kerry }> Sainsbury) writes: }>> }>> SELECT prodno, desc FROM product }>> WHERE ROWID = -1 }>> INSERT INTO TEMP mytemp }> }>Or just: }> }> select * }> from real_tab }> where 1 = 2 }> into temp temp_tab with no log ; } }Note that each of the above methods is a query for which the engine will }attempt to find all rows that satisfy the WHERE clause. } }In the first case, the index on ROWID will be used, which will cause the }query to execute quickly. Hopefully no ROWID will exist equal to (-1). }I'm fairly certain you can count on this with SE, but I don't know with }OnLine. Anyone know for sure? I am fairly sure that ROWID will not be -1, even in OnLine. However, it is important to note that beginning with V.7, if you fragment your tables, ROWID as it is in pre 6.0 versions, will NOT be unique, nor will it be desirable to use. For anyone who does not know, ROWID changes in ver 7, on tables that are fragmented. A ROWID can be used, but becomes an added column to the table, as a serial field. Lookups based on ROWID in this example, provide no gain, over key-based lookups. (not to mention the added overhead of an additional indexed column). Jon ================================================================== Jon Vemo Internet: jvemo@cyberspace.com Bothell, WA USA ------------------------------------------------------------------ Watch out for road-kill on the information superhighway....SPLAT!! ==================================================================