I am running a report in MySQL. One of the queries involves nesting a large number of rows in a temp table. When I try to run it, I get this error:
Error code 1206: the number of locks exceeds the size of the lock table.
Asked requests:
create temporary table SkusBought( customerNum int(11), sku int(11), typedesc char(25), key `customerNum` (customerNum) )ENGINE=InnoDB DEFAULT CHARSET=latin1; insert into skusBought select t1.* from (select customer, sku, typedesc from transactiondatatransit where (cat = 150 or cat = 151) AND daysfrom07jan1 > 731 group by customer, sku union select customer, sku, typedesc from transactiondatadelaware where (cat = 150 or cat = 151) AND daysfrom07jan1 > 731 group by customer, sku union select customer, sku, typedesc from transactiondataprestige where (cat = 150 or cat = 151) AND daysfrom07jan1 > 731 group by customer, sku) t1 join (select customernum from topThreetransit group by customernum) t2 on t1.customer = t2.customernum;
I read that modifying the configuration file to increase the size of the buffer pool will help, but it does nothing. What is the way to fix this as a temporary workaround or permanent fix?
EDIT: changed part of the request. This should not affect it, but I still found, replaced everything and did not understand that it ruined it. Does not affect the question.
EDIT 2: Added typedesc to t1. I changed it in the request, but not here.
sql mysql
maxman92 Aug 01 '11 at 15:59 2011-08-01 15:59
source share