I have around 70 Million
record in files, and i have to read all the record and insert it into MYSQL
database. I take about 2 days
to insert all the data, the issue is that now i have to add few conditions before adding them to the database. But when i add condition it take more days to complete. And this process is done every week
. So if it take 4 days to read and sort the data in 7 days week, then there will be no use of it.
Is there any quick why so that it take less time to read the data.
Current File size: 500MB
The main condition is that when i read the data and it not meat the requirement then that data store in an other table.
I have an other option as well for this.
If this will not done. I have to show data in front-end after the insertion. Let's suppose there is no quick way to minimize the time. so after the insertion of all data, i have to show this data on front-end
and 100
records per page, so is there any way i make condition in pagination that it will show only 100 record which meat my requirements and next 100
which meat requirements.
Let suppose i Read 100
record and in 100 there is only 80 record which meat my requirements. so that 1st page must pull 20
more record which meat my requirements.
Here is The example of the data and how it show work
master_account_number,sub_account_number,current_balance,first_name,last_name,city,state,zip,client_id
01-962040041,01-000050003,11.25,IRENE,AULTMAN,MICHELLVILLE,MD,20721,000969
I need this format for every row. If any field is empty
it will be consider as a bad data
and store in other table. Or if format of the data not match then it also consider as a bad data
. If balance is zero
then also bad data, and many more conditions as well.
i am using
Codeigniter
IIS 7 Server
MYSQL
Storing all data as a string
And i use this query to load the data into DB
.
LOAD DATA INFILE 'C:\\inetpub\\wwwroot\\www.suburbancredit.com\\csv\\atest.csv'
INTO TABLE accounts
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(`accountNumber`, `caseNumber`, `current_balance`, `first_name`, `last_name` , `city`, `state`, `zip`, `client_id`)