Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • entries
    54
  • comments
    615
  • views
    29,797

Оптимизация подсчета товаров Hello Toporchillo


Yoda

1,797 views

 Share

Помнится мне в версиях 1.5.x появилась фича от Toporchillo  с модификацией запросов подсчета товаров при помощи SQL_CALC_FOUND_ROWS.


А я тогда говорил, что это бред! И правильно использовать второй полноценный запрос для getTotalProducts.


В 1.5 совсем плохо было с индексами и на небольших базах это возможно имело смысл. Но когда сейчас каждый второй магазин от 10 000 товаров, FULLSCAN всех таблиц участвующих в выборке товаров  в категории и механизм FOUND_ROWS скорее вреден чем полезен и вот вам подтверждение с официального блога Percona

 

https://www.percona.com/blog/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/

 

Учиться, учиться и еще раз учиться! (c)

  • +1 1
 Share

0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.