I have a 150 gb MYSQL table(innodb) which is not currently using. I am sort of disk so I need to truncate the table and reclaim the space. innodb_file_per_tble is on. Table truncation is in process from last one hour but still not truncated. There are no foreign key checks only 3 or 4 indexes. After checking the show processlist it's showing state updating. Need some tips and help what is the best possible way(truncate/drop). What's mysql tried to do internally? Table size 150gb.space left at machine-35gb. Your help will be truly appreciated.
Need Help regarding Mysql Truncate table
420 Views Asked by Ankush sharma At
1
There are 1 best solutions below
Related Questions in MYSQL
- MySQL Select Rank
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Push mysql database script to server using git
- Why does mysql stop using indexes when date ranges are added to the query?
- Google Maps API Re-size
- store numpy array in mysql
- Whats wrong with this query? Using ands
- MySQL-Auto increment
- show duplicate values subquery mysql
- Java Web Application Query Is Not Working
- microsoft odbc driver manager data source name not found and no default driver specified
- Setting foreign key in phpMyAdmin
- No responses from google places text search api
- Adding to MAMP database in SQL/PHP
- I want to remove certain parent- and child-divs in all my wordpress posts with php or some other script
Related Questions in INNODB
- Do I have to drop the primary key or reload the table data for partitioning in MySQL InnoDB?
- MYSQL innoDB SELECT FOR UPDATE with LEFT JOIN
- MariaDB/MySQL: Get checksum of InnoDB table
- Very basic MySQL query returning zero rows after upgrading from 5.1 to 5.6 and switching to InnoDB from MyISAM
- MySQL error: The maximum column size is 767 bytes
- MySQL Auto-Increment with several different user-input words
- How to speed up slow MySQL UPDATE queries with InnoDB tables
- Mysql Innodb deadlock problems on REPLACE INTO
- SQL: Changing structure of sql table with a million rows
- Why does this InnoDB deadlock occur on a simple UPDATE?
- Optimizing MySQL InnoDB insert through PHP
- Slow update/delete on InnoDB table
- Doctrine cascade update - reset child entity before persist on update
- MySQL: When are Referential Actions (ON DELETE; ON UPDATE) executed?
- Rebuild index on InnoDB
Related Questions in TRUNCATE
- Java format integer limiting width by truncating to the right
- Is it possible to truncate date to Month with Java 8?
- Truncating HTML content at the end of text blocks (block elements)
- Create table without drop if its exist
- Truncate selected tables in SQL Server
- String data right truncation DB2 error
- Android Textview Truncate
- Truncating variable MATLAB
- Data Truncation on SBS2008
- db2batch -w switch and import operation
- Postgres Trunc return of ST_Area() postGIS
- How to truncate text in select box using CSS only
- Easiest way to truncate / trim last character in a file
- PHP Function and Variable inside echo Tag
- How to truncate a double to four digits in hive without rounding?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
For an InnoDB table before version 5.0.3, InnoDB processes TRUNCATE TABLE by deleting rows one by one. As of MySQL 5.0.3, row by row deletion is used only if there are any FOREIGN KEY constraints that reference the table. If there are no FOREIGN KEY constraints, InnoDB performs fast truncation by dropping the original table and creating an empty one with the same definition, which is much faster than deleting rows one by one. (When fast truncation is used, it resets any AUTO_INCREMENT counter to zero. From MySQL 5.0.13 on, the AUTO_INCREMENT counter is reset to zero by TRUNCATE TABLE, regardless of whether there is a foreign key constraint.)
Check this out: http://dev.mysql.com/doc/refman/5.0/en/truncate-table.html