A
A
Alexander Timofeev2015-06-23 00:47:59
MySQL
Alexander Timofeev, 2015-06-23 00:47:59

Number of ads in categories with filter?

Hello.
Suppose you need to find the number of ads for each brand (essentially a category), or model (essentially a sub-category), while taking into account cities and regions, in principle, the principle of operation of auto.ru and the like is interesting when the number of ads near brands change depending on the cities you choose!
I would like to understand the very essence of how it works, because I understand that making a request in which there is a request with a search and a condition in all ads for each brand or model will somehow be expensive, given that I can throw a dozen cities, while there are a lot of ads on some resources!
Thanks :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Timofeev, 2015-06-23
@Sun_ua

I understand the logic of the site :)
The question was more about the architecture of the database or the cunning of requests.
This is closer to my question, add a table of city indexes and the number of ads, and refer to it, and not constantly count count, something like (id_city, id_region, id_brand, ad_count) , thanks I will think ..
In general, quite specific question, a similar mechanism is on many resources.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question