我有两个表结构如下,这些表有很多数据但不能改变表结构
表“售后”
CREATE TABLE IF NOT EXISTS `postsale` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`season` varchar(25) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`sale_no` int(5) NOT NULL,
`auction_date` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`season_time` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`lot_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`invoice_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`origin` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`tea_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`sub_tea_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`category` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`mark` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`grade` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`no_of_packages` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`gross_wt` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`net_wt` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auction_valuation` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`lsp_sp` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`package_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`package_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`quantity` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auctioneer` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auction_price` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`buyer` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`area` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`broker_code` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`csv` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`session` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=29623 ;
和表压轴
CREATE TABLE IF NOT EXISTS `finalsale` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`season` varchar(25) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`sale_no` int(5) NOT NULL,
`auction_date` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`season_time` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`lot_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`invoice_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`origin` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`tea_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`sub_tea_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`category` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`mark` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`grade` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`no_of_packages` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`gross_wt` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`net_wt` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auction_valuation` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`lsp_sp` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`package_type` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`package_no` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`quantity` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auctioneer` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`auction_price` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`buyer` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`area` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`broker_code` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`csv` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
`session` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=41365 ;
基于上面两个表,这个查询的执行时间是巨大的,所以我需要优化下面的查询
UPDATE `finalsale`,`postsale`
SET
`finalsale`.`auction_price`=`postsale`.`auction_price`,
`finalsale`.`csv`=`postsale`.`csv`,
`finalsale`.`session`=`postsale`.`session`
WHERE `finalsale`.`lot_no`=`postsale`.`lot_no`
AND `finalsale`.`group_id`=`postsale`.`group_id`
AND `finalsale`.`group_id`='201217CLGuwahatiJT'
请帮忙