Hi, On Wed, 2002-03-06 at 15:50, Scalper wrote: > If I create a temporary heap table from a select statement, does the new > table also inherit the indexes (indices?) from the original table. Or will
I think that every CREATE [...] TABLE [...] SELECT does not inherit any indexes (doesn't matter which table type it is). It's a reasonable behavior, but you may test it! A solution is doing the CREATE .. SELECT and then do an ALTER TABLE ADD INDEX... > I have to add an index to the temporary table after it is created? > > For example, if I use: > > CREATE TEMPORARY TABLE tempstudents TYPE=HEAP SELECT studentid, > studentlastname FROM students; > > assuming that studentid and studentlastname have indexes on them. > > Will I then have to add indexes to these two fields in the temporary table? > > Thanks, > Craig -- dsoares (sql) --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php