~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/truncate.rst

  • Committer: Lee Bieber
  • Date: 2011-01-15 03:08:27 UTC
  • mfrom: (1994.5.38 doc)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: kalebral@gmail.com-20110115030827-0h9s99kiknrmt9ti
Merge Stewart - some documentation clean up

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
TRUNCATE
2
2
========
3
3
 
 
4
FIXME: I don't think the below SERIAL/AUTO_INCREMENT thing below is true.
 
5
 
4
6
This will delete all data in a table but unlike a DROP TABLE it will allow you to keep the table in your database. It deletes the rows but leaves all counters, such as a SERIAL, in place. ::
5
7
 
 
8
 
6
9
        TRUNCATE TABLE table_name
 
10
 
 
11
TRUNCATE TABLE is typically faster than a DELETE * FROM TABLE query. An
 
12
unbounded DELETE query will have to generate undo log data for every
 
13
row in the table, which could be quite large. TRUNCATE TABLE is the same
 
14
as DROP followed by CREATE except that the absence of the table between
 
15
DROP and CREATE is not exposed.
 
16