Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Fast Insert Where Not Exist (4 replies)

$
0
0
Hi,

Anyone can help on how this insert where not exist faster, currently the sql statement below working but it takes 1hour 42minutes for 65k records.

INSERT INTO exclusive (lname,fname,mname,address,city,state,zip)
SELECT lname,fname,mname,address,city,state,zip
FROM exclusive_temp a
WHERE NOT EXISTS (SELECT lname,fname,mname,address,city,state,zip
FROM exclusive b
where concat(a.lname,a.fname,a.mname,a.address,a.city,a.state,a.zip) = concat(b.lname,b.fname,b.mname,b.address,b.city,b.state,b.zip)
and b.deleted_date is null)
group by a.lname,a.fname,a.mname,a.address,a.city,a.state,a.zip;

Thanks in Advanced.

Regards,
FPalero

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>