Check the weight when inserting a large amount of mssql or mysql data (about 15 million to 20 million)

recently, I am working on a book information management system. There is a table marc that stores the information of books. There are more than 20 fields in it.

when importing data, it is required to check the duplicates according to 7 fields, and the amount of data is about 15 million to 20 million

.

the method currently used is to create a key based on these seven fields

clipboard.png

the client checks duplicates by catching errors when importing data

what I want to ask now is whether there is a better solution, or whether setting triggers is feasible for this situation

because the index is too large after all the data is imported, now I"d like to see if there are other ways to avoid this

Database SQL server 2008R or MySql 5.8 + can be

Jun.21,2022

you can connect seven fields to get the hash value, then create a hash table and repeat it yourself outside the database

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35761-2bf8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35761-2bf8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?