Process MySQL table records without locking the table
$30-250 USD
Fechado
Publicado há mais de 12 anos
$30-250 USD
Pago na entrega
THIS IS FOR MYSQL AND PHP EXPERTS ONLY!
We will evaluate each bid and the work done. If we are satisfied with the results we will need several other scripts to perform more complex tasks.
We are in need of a script able to process the following MySQL table records:
Table 1:
ad_zone_click_id int(11) No
user_id int(11) No
ad_zone_id int(11) No
ad_zone_view_id int(11) No
camp_id int(11) No
ad_zone_click_date datetime No
ad_zone_click_value decimal(10,7) No
ad_zone_click_ip varchar(15) No
Table 2:
ad_zone_id int(11) No
user_id int(11) No
ad_zone_click_date date No
ad_zone_click_count int(11) No
ad_zone_click_value decimal(10,7) No
ad_zone_click_paid tinyint(1) No 0
ad_zone_click_paid_date date No
payment_id int(11) No
We need a script able to take all records for each ad_zone_id when the ad_zone_click_date is older than X. Calculate the total SUM(ad_zone_click_value) and COUNT(*) for each day (one row per day and per ad_zone_id) and then insert or update table 2 with a new row for that specific ad_zone_click_date and that specific ad_zone_id. Once done, delete the records that were processed (one delete per day and zone to avoid table locks).
All SELECT commands to table 1 must NOT lock the table.
We have another option, creating a new table and copy (without locking the table) the records to be processed to avoid table locks on SELECTS.
Once again, ONLY MYSQL AND PHP EXPERTS!