Rails SELECT 40001 SQL_NO_CACHE fired from unknown place

1k Views Asked by At

In MySQL DB server we have schema named test. The schema has table named users.

The table users not used in any place by rails application. The only place the entry for users found is in schema.rb.

The users tables has some data stored and data gets inserted by another java application which runs on some other server. The rails application makes API call to JAVA application via HTTPs and retrieves the data for usage if needed.

Daily the MySQL Master DB gets replicated to Slave server.

During replication the bellow query getting logged in slow logs and its making replication lag.

root    localhost   test Query  93  Sending data    SELECT /*!40001 SQL_NO_CACHE */ * FROM `users`
root    localhost   test Query  62  Writing to net  SELECT /*!40001 SQL_NO_CACHE */ * FROM `users`

This query is not fired from Rails application - we can see the user and host of the connection in logs is root and localhost.

I would be very grateful if someone helps me to identify origin of the query and how can or what can be done to avoid query.

1

There are 1 best solutions below

0
On BEST ANSWER

I had the same problem. In my case it was due to calling mysqldump.