I've got a table with 103M+ records in it and takes up 70GB on the disk. I decided to DELETE (in one statement) 70% of the records.
As expected, this took an awfully long time to run. I decided to KILL that DELETE command before it finished (although it had been running for approx. 350K seconds, as shown by SHOW PROCESSLIST).
The command (as shown by SHOW PROCESSLIST) has now changed to 'Killed' with the state now being 'freeing items'. It is still running, now with a time of 450K seconds.
My question is this, is there anything that I can do to actually stop the command from running? To stop it from doing the freeing? Will restarting mysqld itself have that effect?
Is there anyway to judge how far through its freeing process it has gotten?
I ask because, it is actually using a lot of the machine's resources and is having an impact on the performance of the rest of the application.
show processlist;
| Command | Time | State | Info
| Killed | 449822 | freeing items | DELETE FROM *****
As requested, here is the create table and delete statements in question:
DELETE FROM adc_fetched_documents WHERE id <= 73097292
CREATE TABLE `adc_fetched_documents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`adc_fetch_run_id` int(20) NOT NULL,
`adc_linked_from_id` int(20) DEFAULT NULL,
`adc_fetched_document_blob_id` int(20) DEFAULT NULL,
`adc_scraped_property_id` int(20) DEFAULT NULL,
`adc_duplicate_document_id` int(20) DEFAULT NULL,
`status` int(11) NOT NULL,
`document_type_id` int(4) NOT NULL,
`fetched_at` datetime NOT NULL,
`checksum` varchar(256) DEFAULT NULL,
`http_response_code` int(11) DEFAULT NULL,
`content_type` varchar(256) DEFAULT '',
`url` text,
`http_header` text,
`search_frag_id` int(11) DEFAULT NULL,
`adc_property_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `FK_ADC_DUPLICATE_OF` (`adc_duplicate_document_id`),
KEY `FK_ADC_FETCHED_DOCUMENT_BLOB` (`adc_fetched_document_blob_id`),
KEY `FK_ADC_FETCHED_DOCUMENT_SCRAPED` (`adc_scraped_property_id`),
KEY `FK_ADC_URL_FROM_RUN` (`adc_fetch_run_id`),
KEY `FK_SCR_URL_LINKED_FROM` (`adc_linked_from_id`),
KEY `index_adc_fetched_documents_on_adc_fetch_run_id` (`adc_fetch_run_id`),
KEY `index_adc_fetched_documents_on_adc_linked_from_id` (`adc_linked_from_id`),
KEY `index_adc_fetched_documents_on_adc_fetched_document_blob_id` (`adc_fetched_document_blob_id`),
KEY `index_adc_fetched_documents_on_adc_scraped_property_id` (`adc_scraped_property_id`),
KEY `index_adc_fetched_documents_on_adc_duplicate_document_id` (`adc_duplicate_document_id`),
KEY `index_adc_fetched_documents_on_document_type_id` (`document_type_id`),
KEY `index_adc_fetched_documents_on_checksum` (`checksum`),
KEY `index_adc_fetched_documents_on_search_frag_id` (`search_frag_id`),
KEY `index_adc_fetched_documents_on_adc_property_id` (`adc_property_id`),
CONSTRAINT `adc_fetched_documents_fetch_run` FOREIGN KEY (`adc_fetch_run_id`) REFERENCES `adc_fetch_runs` (`id`),
CONSTRAINT `adc_fetched_documents_parent` FOREIGN KEY (`adc_linked_from_id`) REFERENCES `adc_fetched_documents` (`id`) ON DELETE CASCADE,
CONSTRAINT `adc_fetched_documents_scraped_property` FOREIGN KEY (`adc_scraped_property_id`) REFERENCES `adc_scraped_properties` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=107925926 DEFAULT CHARSET=latin1
As for my it's taken so long to perform the DELETE, I'm not too worried about for now. I assume that there are various variables that need tweaking.
Many thanks in advance for any help.
DELETE
statement and theCREATE TABLE
statement of the table you are running theDELETE
on.