I basically have this web page where you can narrow your search results by adding and removing certain filters on the left hand side.
The content being pulled from the database is a list of properties, which can be filtered by:
- Type ( Apartment, Camp, Ranch, Fishing Camp, Hotel, Lodge )
- Activities ( Camping, Kayaking, Hunting )
- Location ( Idaho, Illinois, Indiana )
So everytime I click on one of the valid filters on the left side, it adds that to the filtering criteria which is used in an ajax request. This joins the minimum number of tables necessary and returns the results.
So if I play around and activate/de-activate I can easily do around 20-30 ajax requests in about a minute ( You are only allowed to filter one of each type at a time unless you de-activate though ).
Question: I'm wondering if I should have instead pulled all the possible properties and just filtered them instead of querying the database per each ajax request, which has at least 2-3 LEFT JOIN
s per transaction.
There are going to be less than 100 properties, I'm not dealing with hundreds or thousands.