1

I have one table which has 13.236.327 rows and the size of the table is approx 500MB, While I perform simple insert query it take more time. In New Relic also it present as slow query. I have only 3 columns in the table and there is no INDEX in that table. Check below image for the table structure.

Table

I am thinking to drop the "on update CURRENT_TIMESTAMP" from last column and while create the query then get the current datetime and then insert, will it speed up the insert?

Jouby
  • 2,196
  • 2
  • 21
  • 33
  • Check it and measure the timings. – hsz Jul 21 '17 at 07:45
  • you should have `index` on large tables – Yaman Jain Jul 21 '17 at 07:48
  • This table used only to store record, No SELECT query on this table, so not created any INDEX. The INDEX will help in SELECT, not in INSERT, wile the INDEX can slow down the INSERT. – Tanmay Maity Jul 21 '17 at 07:55
  • 1
    Possible duplicate of [MySQL optimizing INSERT speed being slowed down because of indices](https://stackoverflow.com/questions/16977898/mysql-optimizing-insert-speed-being-slowed-down-because-of-indices) – Dez Jul 21 '17 at 08:13
  • 1
    No `SELECT` query on that table? So you absolutely never use it to check the data you saved? Really? What's the point of it then? Your question can't be answered because the assumption is that size of the table is at fault. What about the hardware? – Mjh Jul 21 '17 at 08:16
  • Now we are not using the table, but we have some future plan, this table is to store the ip of all logged in user. My question is why the INSERT is slow, – Tanmay Maity Jul 21 '17 at 08:52

0 Answers0