DELETE LOW_PRIORITY QUICK FROM tablename WHERE col_name="XX" took 40 minutes to delete 16M adjacent rows from the front of a fully-indexed, ordered table with no other activity interfering with the operation. That seems very slow! (Many other operations, e.g. INSERT INTO WHERE (SELECT...), seem very slow also, so slow I keep checking SMART to see whether the disc is on the verge of collapse (smartctl claims it's not).
It's definitely indexed, because I wondered the same thing (even though I'd created it myself!) and did a DESCRIBE several times, half-expecting to see that I'd hallucinated the indexing.
I didn't run EXPLAIN because the delete was so straightforward: DELETE FROM raw_tags WHERE ParType='pt'.
I said that the records were at the front of the table, but that was me being foggy: they comprised the largest block of records, and were in "the middle": after a block about a third that size and before a very much smaller (1.5M) block. They were all in that one big block, no scattering at all. So it should have been: mark the FBA and LBA for the block to be overwritten, do the overwrite, prune the Btree, decrement the FBAs for the moved block, and adjust the table length. Easy-peasy.
No, it wasn't swapping. It never used more than 1 of the 8 cores and there was plenty uncommitted memory available. It could have loaded both files into memory (6.5GB, 5GB) and done the work there, but doesn't seem to have loaded either one.
M MacDonald
added a comment - - edited v10.1.22.
It's definitely indexed, because I wondered the same thing (even though I'd created it myself!) and did a DESCRIBE several times, half-expecting to see that I'd hallucinated the indexing.
I didn't run EXPLAIN because the delete was so straightforward: DELETE FROM raw_tags WHERE ParType='pt'.
The table structure is quite simple:
raw_tags | CREATE TABLE `raw_tags` (
`ParentType` char(2) NOT NULL,
`ParentID` bigint(20) NOT NULL,
`K` varchar(64) NOT NULL DEFAULT '',
`V` varchar(1024) NOT NULL DEFAULT '',
KEY `ParentType` (`ParentType`,`ParentID`),
KEY `K` (`K`),
KEY `V` (`V`),
KEY `ParentID` (`ParentID`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
I said that the records were at the front of the table, but that was me being foggy: they comprised the largest block of records, and were in "the middle": after a block about a third that size and before a very much smaller (1.5M) block. They were all in that one big block, no scattering at all. So it should have been: mark the FBA and LBA for the block to be overwritten, do the overwrite, prune the Btree, decrement the FBAs for the moved block, and adjust the table length. Easy-peasy.
No, it wasn't swapping. It never used more than 1 of the 8 cores and there was plenty uncommitted memory available. It could have loaded both files into memory (6.5GB, 5GB) and done the work there, but doesn't seem to have loaded either one.
What mariadb version? Are sure it's indexed? What does EXPLAIN DELETE .. WHERE.. Show? What's the table structure? (SHOW CREATE TABLE tblname)
Daniel Black
added a comment - What mariadb version? Are sure it's indexed? What does EXPLAIN DELETE .. WHERE.. Show? What's the table structure? (SHOW CREATE TABLE tblname)
People
Unassigned
M MacDonald
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":5771.400000095367,"ttfb":5197.400000095367,"pageVisibility":"visible","entityId":61553,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0,"journeyId":"498495f6-275e-4ce2-a13a-baf255cedb68","navigationType":0,"readyForUser":5867.400000095367,"redirectCount":0,"resourceLoadedEnd":5541.800000190735,"resourceLoadedStart":5206.900000095367,"resourceTiming":[{"duration":42.299999713897705,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":5206.900000095367,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5206.900000095367,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5249.199999809265,"responseStart":0,"secureConnectionStart":0},{"duration":42.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":5207.199999809265,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5207.199999809265,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5249.699999809265,"responseStart":0,"secureConnectionStart":0},{"duration":156.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":5207.400000095367,"connectEnd":5207.400000095367,"connectStart":5207.400000095367,"domainLookupEnd":5207.400000095367,"domainLookupStart":5207.400000095367,"fetchStart":5207.400000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5254,"responseEnd":5363.599999904633,"responseStart":5265.900000095367,"secureConnectionStart":5207.400000095367},{"duration":290,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":5207.5,"connectEnd":5207.5,"connectStart":5207.5,"domainLookupEnd":5207.5,"domainLookupStart":5207.5,"fetchStart":5207.5,"redirectEnd":0,"redirectStart":0,"requestStart":5254.900000095367,"responseEnd":5497.5,"responseStart":5270.800000190735,"secureConnectionStart":5207.5},{"duration":61.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":5207.800000190735,"connectEnd":5207.800000190735,"connectStart":5207.800000190735,"domainLookupEnd":5207.800000190735,"domainLookupStart":5207.800000190735,"fetchStart":5207.800000190735,"redirectEnd":0,"redirectStart":0,"requestStart":5255.199999809265,"responseEnd":5269.5,"responseStart":5267.699999809265,"secureConnectionStart":5207.800000190735},{"duration":74.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":5207.900000095367,"connectEnd":5207.900000095367,"connectStart":5207.900000095367,"domainLookupEnd":5207.900000095367,"domainLookupStart":5207.900000095367,"fetchStart":5207.900000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5258.099999904633,"responseEnd":5282.5,"responseStart":5272.5,"secureConnectionStart":5207.900000095367},{"duration":77.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":5208.099999904633,"connectEnd":5208.099999904633,"connectStart":5208.099999904633,"domainLookupEnd":5208.099999904633,"domainLookupStart":5208.099999904633,"fetchStart":5208.099999904633,"redirectEnd":0,"redirectStart":0,"requestStart":5258.300000190735,"responseEnd":5285.699999809265,"responseStart":5283,"secureConnectionStart":5208.099999904633},{"duration":47.200000286102295,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":5208.199999809265,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5208.199999809265,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5255.400000095367,"responseStart":0,"secureConnectionStart":0},{"duration":83.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":5208.400000095367,"connectEnd":5208.400000095367,"connectStart":5208.400000095367,"domainLookupEnd":5208.400000095367,"domainLookupStart":5208.400000095367,"fetchStart":5208.400000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5258.900000095367,"responseEnd":5291.900000095367,"responseStart":5287.800000190735,"secureConnectionStart":5208.400000095367},{"duration":48.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":5208.800000190735,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":5208.800000190735,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5257.400000095367,"responseStart":0,"secureConnectionStart":0},{"duration":80.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":5208.900000095367,"connectEnd":5208.900000095367,"connectStart":5208.900000095367,"domainLookupEnd":5208.900000095367,"domainLookupStart":5208.900000095367,"fetchStart":5208.900000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5261.5,"responseEnd":5289.599999904633,"responseStart":5287.099999904633,"secureConnectionStart":5208.900000095367},{"duration":329.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":5211.900000095367,"connectEnd":5211.900000095367,"connectStart":5211.900000095367,"domainLookupEnd":5211.900000095367,"domainLookupStart":5211.900000095367,"fetchStart":5211.900000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5400.099999904633,"responseEnd":5541.099999904633,"responseStart":5535.5,"secureConnectionStart":5211.900000095367},{"duration":329.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":5211.900000095367,"connectEnd":5211.900000095367,"connectStart":5211.900000095367,"domainLookupEnd":5211.900000095367,"domainLookupStart":5211.900000095367,"fetchStart":5211.900000095367,"redirectEnd":0,"redirectStart":0,"requestStart":5401.800000190735,"responseEnd":5541.800000190735,"responseStart":5537.099999904633,"secureConnectionStart":5211.900000095367},{"duration":94.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":5491.699999809265,"connectEnd":5491.699999809265,"connectStart":5491.699999809265,"domainLookupEnd":5491.699999809265,"domainLookupStart":5491.699999809265,"fetchStart":5491.699999809265,"redirectEnd":0,"redirectStart":0,"requestStart":5553.699999809265,"responseEnd":5586.5,"responseStart":5585.800000190735,"secureConnectionStart":5491.699999809265},{"duration":203,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":5728.599999904633,"connectEnd":5728.599999904633,"connectStart":5728.599999904633,"domainLookupEnd":5728.599999904633,"domainLookupStart":5728.599999904633,"fetchStart":5728.599999904633,"redirectEnd":0,"redirectStart":0,"requestStart":5899.5,"responseEnd":5931.599999904633,"responseStart":5930.900000095367,"secureConnectionStart":5728.599999904633}],"fetchStart":0,"domainLookupStart":45,"domainLookupEnd":5031,"connectStart":5031,"connectEnd":5049,"secureConnectionStart":5039,"requestStart":5051,"responseStart":5197,"responseEnd":5210,"domLoading":5201,"domInteractive":5915,"domContentLoadedEventStart":5915,"domContentLoadedEventEnd":5959,"domComplete":6137,"loadEventStart":6137,"loadEventEnd":6137,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":5893.800000190735},{"name":"bigPipe.sidebar-id.end","time":5894.599999904633},{"name":"bigPipe.activity-panel-pipe-id.start","time":5894.699999809265},{"name":"bigPipe.activity-panel-pipe-id.end","time":5896},{"name":"activityTabFullyLoaded","time":5979.199999809265}],"measures":[],"correlationId":"412886d2b5cb51","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
v10.1.22.
It's definitely indexed, because I wondered the same thing (even though I'd created it myself!) and did a DESCRIBE several times, half-expecting to see that I'd hallucinated the indexing.
I didn't run EXPLAIN because the delete was so straightforward: DELETE FROM raw_tags WHERE ParType='pt'.
The table structure is quite simple:
raw_tags | CREATE TABLE `raw_tags` (
`ParentType` char(2) NOT NULL,
`ParentID` bigint(20) NOT NULL,
`K` varchar(64) NOT NULL DEFAULT '',
`V` varchar(1024) NOT NULL DEFAULT '',
KEY `ParentType` (`ParentType`,`ParentID`),
KEY `K` (`K`),
KEY `V` (`V`),
KEY `ParentID` (`ParentID`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
I said that the records were at the front of the table, but that was me being foggy: they comprised the largest block of records, and were in "the middle": after a block about a third that size and before a very much smaller (1.5M) block. They were all in that one big block, no scattering at all. So it should have been: mark the FBA and LBA for the block to be overwritten, do the overwrite, prune the Btree, decrement the FBAs for the moved block, and adjust the table length. Easy-peasy.
No, it wasn't swapping. It never used more than 1 of the 8 cores and there was plenty uncommitted memory available. It could have loaded both files into memory (6.5GB, 5GB) and done the work there, but doesn't seem to have loaded either one.