It's my understanding that doing a simple delete
delete from table_name
actually DOES drop and recreate the table (and thus its indexes). On the
other hand, if you are continually adding & deleting records, you might
well need to do a periodic 'analyze table_name' or 'optimize table_name' to
maintain optimum performance & clear the deleted record chain.
steve
At 03:21 PM 2/19/04, Jeff McKeon wrote:
>Quick question...
>
>What you drop a table are the indexes for that table dropped to?
>
>I'm about to write a script to take a data pull every night and
>re-populate a table with the results, then have my apps run off of the
>new consolidated table for a speed increase. If I drop the Consolidated
>table, then re-create it with the new data pull, will I need to
>re-create the indexes as well?
>
>Is there any performance cost/benefit to simply deleting all data from
>the table and then re-populating it as opposed to droping and
>re-creating it?
>
>Thanks,
>
>Jeff
+------------------------------------------------------------------------+
| Steve Edberg sbedberg@stripped |
| Database/Programming/SysAdmin (530)754-9127 |
| University of California, Davis http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+