~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/truncate.rst

  • Committer: Stewart Smith
  • Date: 2010-11-07 04:22:31 UTC
  • mto: (1911.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1912.
  • Revision ID: stewart@flamingspork.com-20101107042231-ola4sl7j0qvg58tz
fix ARCHIVE storage engine calling exit (lintian warning). Was because we were linking in libinternal into libazio, which links into archive plugin. Just link libinternal into the command line utilities.

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.
9
 
 
10
 
.. code-block:: mysql
11
 
 
12
 
        TRUNCATE TABLE table_name
13
 
 
14
 
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
16
 
row in the table, which could be quite large. TRUNCATE TABLE is the same
17
 
as DROP followed by CREATE except that the absence of the table between
18
 
DROP and CREATE is not exposed.
19
 
 
 
4
TRUNCATE TABLE table_name
 
5
 
 
6
This will delete all data in a table but unlike a DROP TABLE it will keep all counters, such as a SERIAL, in place.