I
I
i_want_to_know_everything2016-10-26 12:40:08
MySQL
i_want_to_know_everything, 2016-10-26 12:40:08

WordPress database indexing?

I implement data filtering on WordPress, filtering can be by many custom taxonomies and the value of arbitrary fields that each post can have. Accordingly, you can choose any combination of them.
Requesting this case through WP_Query does everything as expected, but the speed is not very good with 50K+ records.
Now I use a separate table for the filter, where I store for each record all its parameters used for filtering, in this case, the filtering is based on its values ​​and, when forming the page, I drag all the record data from standard tables.
In this case, everything is chic and works quickly. But there is a minus, The initial formation of this table takes a fair amount of time, due to all sorts of not fast WordPress hooks and actions, but this is still half the trouble, the main problem is also a long update of it when batch changing records, due to the same actions and filters.
Is there some alternative storage solution for fast filtering?
Sphinx will not work in this case, the solution should work on an ordinary expensive shared.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Максим Тимофеев, 2016-10-26
@webinar

сделайте индексы в бд на необходимые поля.Вес базы конечно подрастет, но выборка будет идти быстрее. Хотя на мой взгляд пытаться добиться от wp скорости - это как мастерить ebs в ВАЗ 2101. Интересно, но не стоит ни кому рассказывать.
Как вариант еще можно кешировать запросы, если их вариаций не миллион, то вполне решение.

I
Igor Vorotnev, 2016-10-27
@HeadOnFire

elasticpress . For true connoisseurs of shared services, Elastic Search is available as a cloud service.

A
Alexander Taratin, 2016-10-26
@Taraflex

Sphinx won't work in this case.

www.mysql.ru/docs/man/Fulltext_Search.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question