I hope this question is not a duplicate. If it is so, please point me to the right direction.
I have a MySQL MariaDB database table with users. On every year we receive an Excel or CSV file which contains some users which are already stored in table, some users which are not, and some users which are new. I must filter the users based on custom criteria and make sure those which are not present in new Excel/CSV but present in table will be moved to another table. Due to amount of users (~4k/import) I prefer to create a stored procedure with Excel/CSV data passed and let database do this whole job.
How should I do it better? Create the stored procedure, pass the data as BLOB to procedure and iterate over each record using string functions?