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
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to change woocomerce or full wordpress currency with value from USD to AUD
- window.location.href redirects but is causing problems on the webpage
- Error: local variable 'bramka' referenced before assignment
- Products aren't displayed after fetching data from mysql db (node.js & express)
- status table for all entries (even in different dates) in database changing value when all checkboxes are checked
- Can't Fix Mariadb & Mysql ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) On MacOs
- Express Mysql getting max ID from table not working cought in a promise
- failed to upload a table from sql file
- Update a MySQL row depending on the ID in Google Sheets Apps Script
- Use row values from another table to select them as columns and establish relations between them (pivot table)
- SQL: Generate combination table based on source and destination column from same table
- How to display the column names which have only unique non-null values in MySQL table?
- mysql query takes too long because of wrong indexes usage
- Multitable joining in Sql
Related Questions in INNODB
- Solution Indication - Database
- mysql locks relation to indexes
- MySQL table size: Do I need to adjust something?
- MySQL InnoDB: Can one make large inserts from queries run with no rollback penalty
- Gap locks using InnoDB
- Is InnoDB Engine a B Tree or a B+ Tree?
- Implementing Field Level Encryption for Rating Column in MySQL InnoDB Without Modifying Application Code
- How to correctly set the lock in MySQL?
- Undo logs are not truncating even the parameter is set to ON
- InnoDB - errno: 1005, sqlState: 'HY000' sqlMessage: "Can't create table (tableName) (errno: -1)",
- Update a record or insert if it doesn't exists, with locking
- Dynamically create tables by foreign key
- Does Mariadb innodb prioritizes Select NOW() over other selects and inserts
- Trying to add foreign key and an error occured "errno: 150 'Foreign key constraint is incorrectly formed'"
- Using custom locks to insert rows safely
Related Questions in TRUNCATE
- Why am I encountering an error with comm.Bcast() function in mpi4py when broadcasting a numpy array?
- avoid sas removing trailing space
- Remove everything before certain point of a string
- Databricks notebook how to stop truncating numbers when export the query result to csv
- Is there a way to truncate the beginning of numpy memmap files?
- SSIS Truncation may occur due to inserting data from data flow column with a length of 250 to database column with a length of 16
- How to truncate a String in the middle with ellipsis POSIX compliant?
- Truncate longer text-chips before shorter will be truncated
- How to truncate string before POST?
- Avoid "String is too long" Warning with LISTAGG in Snowflake
- Laravel 10: Get the full JSON API Response (not truncated)
- Math.Trunc function reducing the value by 0.001
- TTS truncates audio in the middle of the recording - skips few sentences
- How to make text-overflow : ellipsis work on textarea in react.js + tailwind css
- Powerlevel10K prompt shorten strategy
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 # Hahtags
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