Commit Graph

31 Commits

Author SHA1 Message Date
zimmi1 4f06b74a29 Update Connection.php correction from 717
I'm very very sorry, I produced an error with the last commit on this file: there was an error in parenthesis position on line 117. Line 117 should be as line 131.
(But how did I manage to make this wrong ???)
2013-09-13 11:56:50 +02:00
zimmi1 452f41df8d Speeding up sql queries
Searching for "DATE_ADD(date_add, INTERVAL 30 MINUTE) > now" needs for every line to add 30 minutes to the date. but it is the same operation as comparing "date_add > (now - 30 minutes).
It is faster because there is no DATE_ADD calculation.

The problem:
By profiling speed of my shop, this query appeared after about 3 months always as the absolute slowest query of the shop, needing about 15 to 30 ms to perform, because I have now nearly 700 connections to my shop (and it then browses the 700 lines)

A solution:
Removing DATE_ADD MySql function and using date() and time() functions of php for calculating only once the 30 min. difference.

Using this solution takes it down again to 0.8 to 1.3 ms.

I guess it is the same in case of bots (could be even worse as they can make thousands of connections).
2013-09-13 10:05:30 +02:00
gRoussac 332d68c7ec [-] MO : Statsdata, exception on duplicate entry 2013-09-10 11:08:57 +02:00
Damien Metzger 989dafce21 [*] FO : a few more SQL improvements 2013-07-19 11:29:18 +02:00
Damien Metzger 60671ab46b [-] FO : cut long referrers in order to avoid a crash #PSCFV-7775 2013-02-21 16:19:10 +01:00
Rémi Gaillard 3d456b8c08 // small fix 2013-02-21 15:24:33 +01:00
François Gaillard 064ba453e6 // Welcome 2013 2013-01-04 11:19:03 +01:00
vAugagneur a1db83ef41 //remove svn keyword @version Release: $ 2012-11-22 11:57:40 +01:00
lLefevre 779cf350af // Revert Revision 17884 : #PSCFV-5017 : update bad licenses in all files 2012-10-17 09:29:43 +00:00
lLefevre 046b51ab99 // #PSCFV-5017 : update bad licenses in all files 2012-10-17 06:18:59 +00:00
rMalie 49869aaaaf // MERGE product_multistore branch : product fields are now editable per shop 2012-04-17 13:32:12 +00:00
rMalie 8f0257fc87 // Replace shop->addSqlRestriction() and shop->addSqlRestrictionOnLang() by static versions 2012-02-27 12:15:30 +00:00
rMalie 14e6929565 // Welcome 2012² 2012-02-23 16:33:10 +00:00
rMalie 91aae3e665 // Improve multishop API 2012-02-23 15:39:44 +00:00
rMalie 587a927e76 [*] Classes : Db::autoExecute() call are now replaced by Db::insert() or Db::update() 2012-01-23 17:41:02 +00:00
lLefevre 449113c694 [-] BO : #PSTEST-243 : update date_add for customer connections 2012-01-02 09:27:20 +00:00
rMalie 1506dc39b3 // Format definitions 2011-12-13 13:41:54 +00:00
rMalie 48baf36558 [*] Classes: Remove $fieldsRequired, $fieldsSize and $fieldsValidate (and lang properties) properties, use $definition instead 2011-12-12 18:10:38 +00:00
rMalie d3a24b8622 // Remove $table and $identifier property from all classes, and add static $definition instead 2011-12-05 13:56:03 +00:00
rMalie 201cb34a4d // Some fix on objectModel children classes (fields not valid, etc.) 2011-11-09 12:16:37 +00:00
rMalie e6f45e54a6 // Replace shop->sqlAsso(), shop->sqlLang() and shop->sqlRestriction() with shop->addSqlAssociation(), shop->addSqlRestrictionOnLang() and shop->addSqlRestriction() 2011-10-17 09:46:08 +00:00
rMalie 9510337b1d // Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names 2011-10-10 12:18:56 +00:00
rMalie 0b28aa8f72 // Fix #PSFV-48 2011-08-11 14:42:31 +00:00
tDidierjean 55ee922b16 // Context part 22 2011-07-27 09:01:00 +00:00
rMalie 3f9a9e41d7 // id_shop on cart product (for links) + change Shop::sqlAsso() + share_order 2011-07-22 08:57:51 +00:00
rMalie 02a738dce1 // Context part 15 2011-07-19 16:17:14 +00:00
rMalie 290e1f1f87 2011-07-19 13:55:53 +00:00
rMalie 2d77925e7d // Refactoring of shop class with new context 2011-07-12 16:28:20 +00:00
rGaillard 8fc7f11014 2011-07-06 10:54:11 +00:00
rGaillard d1a13007b9 2011-07-06 10:10:43 +00:00
aFolletete 05a58f53e6 // 1.5 branche creation 2011-04-12 18:24:40 +00:00