How to optimize mysql indexes so that INSERT operations happen quickly on a large table with frequent writes and reads?
问题 I have a table watchlist containing today almost 3Mil records. mysql> select count(*) from watchlist; +----------+ | count(*) | +----------+ | 2957994 | +----------+ It is used as a log to record product-page-views on a large e-commerce site (50,000+ products). It records the productID of the viewed product, the IP address and USER_AGENT of the viewer. And a timestamp of when it happens: mysql> show columns from watchlist; +-----------+--------------+------+-----+-------------------+-------+