Tag Info

New answers tagged

1

Condition 1 : You can define a composite primary key such as : CREATE customerItem ( customer_id INT, item_id INT, view_date DATETIME, PRIMARY KEY (customer_id, item_id) ) You can then use INSERT ... ON DUPLICATE KEY UPDATE such as : INSERT INTO customerItem (customer_id,item_id,view_date) VALUES (123,999,"2014-12-22") ON DUPLICATE KEY UPDATE ...


1

I think your approach is reasanoble. Because it would show online data (no need for background processing) and would only use resources from active transactions (customer not seeing anything will not need to have their data reprocessed). I would do it using triggers. You would not have to change your existing code and you could disable/enable this new ...


0

I see this as a possible scenario in the world of big data, where you may not be performing the traditional select * type of queries. We deal with this in the predictive modeling world at a customer level where we model a customer across thousands of dimensions (all of them having values of 0 or 1). This way of storage makes the downstream model building ...



Top 50 recent answers are included