← Back to team overview

openerp-india team mailing list archive

[Bug 1315694] [NEW] website_sales product list SQL speed problem

 

Public bug reported:

If there is a huge product in the openerp( like 10k , 10k, 100k),the
speed of the product list will very slow(more than 20S per page)
,because of the SQL like blow,they will list   almost  all of the
product IN the ’product_template‘, that will be crazy for huage product
system...

2014-05-03 13:48:06,677 9492 DEBUG CN openerp.sql_db: query: 
SELECT count(*) FROM (SELECT "product_template".id FROM "product_template" WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55)))) ORDER BY "product_template"."website_published" desc,"product_template"."website_sequence" desc,"product_template"."name"  ) AS count


2014-05-03 13:48:06,698 9492 DEBUG CN openerp.sql_db: query: 
SELECT "product_template".id FROM "product_template" WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55)))) ORDER BY "product_template"."website_published" desc,"product_template"."website_sequence" desc  limit 30
			
2014-05-03 13:48:06,726 9492 DEBUG CN openerp.sql_db: query: 
            SELECT min(product_template.id) AS id, count(product_template.id) AS public_categ_id_count , "product_template"."public_categ_id" as "public_categ_id" 
            FROM "product_template" LEFT JOIN "product_public_category" as "product_template__public_categ_id" ON ("product_template"."public_categ_id" = "product_template__public_categ_id"."id")
            WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55))))
            GROUP BY "product_template"."public_categ_id","product_template__public_categ_id"."sequence","product_template__public_categ_id"."name"
            ORDER BY  "product_template__public_categ_id"."sequence" ,"product_template__public_categ_id"."name"

** Affects: openobject-addons
     Importance: Undecided
         Status: New


** Tags: product sales speed website

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1315694

Title:
  website_sales product list SQL speed problem

Status in OpenERP Addons (modules):
  New

Bug description:
  If there is a huge product in the openerp( like 10k , 10k, 100k),the
  speed of the product list will very slow(more than 20S per page)
  ,because of the SQL like blow,they will list   almost  all of the
  product IN the ’product_template‘, that will be crazy for huage
  product system...

  2014-05-03 13:48:06,677 9492 DEBUG CN openerp.sql_db: query: 
  SELECT count(*) FROM (SELECT "product_template".id FROM "product_template" WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55)))) ORDER BY "product_template"."website_published" desc,"product_template"."website_sequence" desc,"product_template"."name"  ) AS count

  
  2014-05-03 13:48:06,698 9492 DEBUG CN openerp.sql_db: query: 
  SELECT "product_template".id FROM "product_template" WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55)))) ORDER BY "product_template"."website_published" desc,"product_template"."website_sequence" desc  limit 30
  			
  2014-05-03 13:48:06,726 9492 DEBUG CN openerp.sql_db: query: 
              SELECT min(product_template.id) AS id, count(product_template.id) AS public_categ_id_count , "product_template"."public_categ_id" as "public_categ_id" 
              FROM "product_template" LEFT JOIN "product_public_category" as "product_template__public_categ_id" ON ("product_template"."public_categ_id" = "product_template__public_categ_id"."id")
              WHERE ((("product_template"."sale_ok" = 'True')  AND  ("product_template"."id" in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198)))  AND  ("product_template"."event_ok" IS NULL or "product_template"."event_ok" = false )) AND ((("product_template"."company_id" = 1)  OR  "product_template"."company_id" IS NULL )  AND  ((("product_template"."website_published" = 'True')  AND  ("product_template"."sale_ok" = 'True'))  OR  ("product_template"."id" in (58,57,56,55))))
              GROUP BY "product_template"."public_categ_id","product_template__public_categ_id"."sequence","product_template__public_categ_id"."name"
              ORDER BY  "product_template__public_categ_id"."sequence" ,"product_template__public_categ_id"."name"

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1315694/+subscriptions


Follow ups

References