~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/truncate.rst

  • Committer: Brian Aker
  • Date: 2011-04-20 14:53:20 UTC
  • mfrom: (1994.4.123 drizzle)
  • Revision ID: brian@tangent.org-20110420145320-fc57pxob4lm0lmu9
Update docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
TRUNCATE
2
2
========
3
3
 
4
 
.. todo::
5
 
 
6
 
   I don't think the below SERIAL/AUTO_INCREMENT thing below is true.
7
 
 
8
 
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.
 
4
This will delete all data in a table but unlike a DROP TABLE it will allow you to keep the table in your database.
9
5
 
10
6
.. code-block:: mysql
11
7
 
12
8
        TRUNCATE TABLE table_name
13
9
 
14
10
TRUNCATE TABLE is typically faster than a DELETE * FROM TABLE query. An
15
 
unbounded DELETE query will have to generate undo log data for every
 
11
unbounded DELETE query will have to generate log data for every
16
12
row in the table, which could be quite large. TRUNCATE TABLE is the same
17
13
as DROP followed by CREATE except that the absence of the table between
18
 
DROP and CREATE is not exposed.
19
 
 
 
14
DROP and CREATE is not exposed.
 
 
b'\\ No newline at end of file'