I have an update query that hangs forever when I run it and I can't figure out why.
Here is the query:
UPDATE DWH_RAP215.`DWH_RAP215` a
LEFT JOIN DWH_RAP215.`TMP_KANNIS038` b ON a.`pht` = b.`PHT`
SET a.`Vectoring_indication` = b.`Vectoring_indication`;
The tables involved in the update has 5.7 million and 4 million rows each.
Both tables have indexes on the join columns.
Below is the InnoDB monitor message I get while this query is running:
TRANSACTION 0 0, not started, process no 8368, OS thread id 140468180481792 MySQL thread id 3979, query id 89130064 144.44.16.179 bugar500
Sending data
UPDATE DWH_RAP215.`DWH_RAP215` a LEFT JOIN DWH_RAP215.`TMP_KANNIS038` b ON a.`pht` = b.`PHT` SET a.`Vectoring_indication` = b.`Vectoring_indication-------- FILE I/O --------
I/O thread 0 state: waiting for i/o request (insert buffer thread) I/O
thread 1 state: waiting for i/o request (log thread) I/O
thread 2 state: waiting for i/o request (read thread) I/O
thread 3 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0, ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0 1341 OS file reads, 7 OS file writes, 7 OS fsyncs 0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
------------------------------------- INSERT BUFFER AND ADAPTIVE HASH INDEX -------------------------------------
Ibuf: size 1, free list len 38, seg size 40, 0 inserts, 0 merged recs, 0 merges Hash table size 17393, node heap has 0 buffer(s) 0.00 hash searches/s, 0.00 non-hash searches/s
--- LOG ---
Log sequence number 52 234205131
Log flushed up to 52 234205131
Last checkpoint at 52 234205131
0 pending log writes, 0 pending chkp writes 10 log i/o's done, 0.00 log i/o's/second
---------------------- BUFFER POOL AND MEMORY ----------------------
Total memory allocated 20420456; in additional pool allocated 1046272
Dictionary memory allocated 287160
Buffer pool size 512
Free buffers 0
Database pages 512
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 1373, created 0, written 1 0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
-------------- ROW OPERATIONS --------------
0 queries inside InnoDB, 0 queries in queue 1 read views open inside InnoDB
Main thread process no. 8368, id 140468427413248, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 5933 0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
---------------------------- END OF INNODB MONITOR OUTPUT ============================
Create statements of the 2 tables:
CREATE TABLE `TMP_KANNIS038` (
`Vectoring_indication` varchar(1) CHARACTER SET latin1 DEFAULT NULL,
`PHT` varchar(17) CHARACTER SET latin1 DEFAULT NULL,
KEY `IDX1` (`PHT`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
CREATE TABLE `DWH_RAP215` (
`pht` varchar(20) DEFAULT NULL,
`cgb` varchar(6) DEFAULT NULL,
`CGB_NAAM_VERKORT` varchar(15) DEFAULT NULL,
`postcode` varchar(6) DEFAULT NULL,
`huisnummer` int(5) DEFAULT NULL,
`huisnummer_toevoeging` varchar(4) DEFAULT NULL,
`BUURT_NAAM` varchar(100) DEFAULT NULL,
`WIJK_NAAM` varchar(100) DEFAULT NULL,
`GEMEENTE` varchar(100) DEFAULT NULL,
`WOONPLAATS` varchar(100) DEFAULT NULL,
`Rayon` varchar(20) DEFAULT NULL,
`LOGISCHE_KABELCODE` varchar(5) DEFAULT NULL,
`lengte_1` int(7) DEFAULT NULL,
`kvd_1` varchar(8) DEFAULT NULL,
`LOGISCHE_KABELCODE_1` varchar(5) DEFAULT NULL,
`lengte_2` int(7) DEFAULT NULL,
`kvd_2` varchar(8) DEFAULT NULL,
`LOGISCHE_KABELCODE_2` varchar(5) DEFAULT NULL,
`lengte_3` int(7) DEFAULT NULL,
`lengte_4` int(7) DEFAULT NULL,
`totale_lengte` int(7) DEFAULT NULL,
`INVOERKABEL` int(5) DEFAULT NULL,
`DADER_NUMMER` char(3) DEFAULT NULL,
`STIJL_HVD` varchar(3) DEFAULT NULL,
`CASSETTE_HVD` varchar(1) DEFAULT NULL,
`STIFT_HVD` varchar(3) DEFAULT NULL,
`STIJL_AFGAAND_1` varchar(3) DEFAULT NULL,
`STIFT_AFGAAND_1` varchar(3) DEFAULT NULL,
`STIJL_AFGAAND_2` varchar(3) DEFAULT NULL,
`STIFT_AFGAAND_2` varchar(3) DEFAULT NULL,
`INVOERADER` int(5) DEFAULT NULL,
`MANPUNT_CODE_EK` varchar(8) DEFAULT NULL,
`MANPUNT_TYPE_EK` varchar(8) DEFAULT NULL,
`LOGISCHE_KABELCODE_EK` varchar(5) DEFAULT NULL,
`VOEDENDE_KVD` varchar(15) DEFAULT NULL,
`Cable-Piece-Number` smallint(4) DEFAULT NULL,
`Location-Code-Up` varchar(8) DEFAULT NULL,
`Location-Code-Down` varchar(8) DEFAULT NULL,
`Capacity` varchar(9) DEFAULT NULL,
`X` int(1) NOT NULL DEFAULT '0',
`Y` int(1) NOT NULL DEFAULT '0',
`Trilink` int(1) DEFAULT NULL,
`Vectoring_indication` varchar(5) DEFAULT NULL,
KEY `IDX1` (`pht`),
KEY `IDX2` (`cgb`),
KEY `IDX3` (`postcode`,`huisnummer`),
KEY `IDX5` (`LOGISCHE_KABELCODE_EK`),
KEY `IDX6` (`DADER_NUMMER`),
KEY `IDX7` (`Rayon`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
Explain plan:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL NULL NULL NULL 5735243
1 SIMPLE b ALL NULL NULL NULL NULL 4027111
Please help.