cancel
Showing results for 
Search instead for 
Did you mean: 

Unkown queries running in 1000s of numbers magento 1.9 without shell and cron jobs.

Unkown queries running in 1000s of numbers magento 1.9 without shell and cron jobs.

Hi ,

I am facing a very strange issue on my magento site on 1.9.2.2 CE 

Thousand of queries ( magento are running in the background without my control) 

I have switched off Magento Cron tabs. There is something which is triggering the code to run these queries. Unable to find what is that. Disabled cache management and cache is empty. And i have not even opened the site in the browser.

I have commented out all the shell php scripts under shell folder of magento.

I have switched off the third party extensions on the site.

 

I disabled the extensions apart from core. but this behaviour persists. 

There are thousands of similar queries

One more thing 

If i switch on the logging from Pdo.php and see the queries logging in logs files in debug file. It stacks up Gbs of log file in minutes. Now even if switch off the logging off 

 

 

## 2017-03-25 15:20:17
## 2474 ## QUERY
SQL: SELECT `main`.`value_id`, `main`.`value` AS `file`, `main`.`entity_id` AS `product_id`, `value`.`label`, `value`.`position`, `value`.`disabled`, `default_value`.`label` AS `label_default`, `default_value`.`position` AS `position_default`, `default_value`.`disabled` AS `disabled_default` FROM `catalog_product_entity_media_gallery` AS `main`
LEFT JOIN `catalog_product_entity_media_gallery_value` AS `value` ON main.value_id = value.value_id AND value.store_id = 1
LEFT JOIN `catalog_product_entity_media_gallery_value` AS `default_value` ON main.value_id = default_value.value_id AND default_value.store_id = 0 WHERE (main.attribute_id = '88') AND (main.entity_id in ('913')) ORDER BY IF(value.position IS NULL, default_value.position, value.position) ASC
AFF: 1
TIME: 0.0192 

## 2017-03-25 15:23:14
## 2474 ## QUERY
SQL: SELECT `main`.`value_id`, `main`.`value` AS `file`, `main`.`entity_id` AS `product_id`, `value`.`label`, `value`.`position`, `value`.`disabled`, `default_value`.`label` AS `label_default`, `default_value`.`position` AS `position_default`, `default_value`.`disabled` AS `disabled_default` FROM `catalog_product_entity_media_gallery` AS `main`
LEFT JOIN `catalog_product_entity_media_gallery_value` AS `value` ON main.value_id = value.value_id AND value.store_id = 1
LEFT JOIN `catalog_product_entity_media_gallery_value` AS `default_value` ON main.value_id = default_value.value_id AND default_value.store_id = 0 WHERE (main.attribute_id = '88') AND (main.entity_id in ('913')) ORDER BY IF(value.position IS NULL, default_value.position, value.position) ASC
AFF: 1
TIME: 0.0024

 

I have switched on the debug profiler. where i am getting these queries. I have tried repairing the database using magento database repair tool. 

I am helpless as of now with this situation.

  I checked almost all from the server side but this issue. Also changing db credentials of my database didnt help. 

 

Kindly help.

code1.PNGcode2.PNG

 

 

1 REPLY 1

Re: Unkown queries running in 1000s of numbers magento 1.9 without shell and cron jobs.

Hi,

 

You can also set

protected $_logCallStack = true;

 in 

Varien_Db_Adapter_Pdo_Mysql

 

That will allow you to see which script call this queries + you can extend logs and dump $_SERVER in logs.