Jump to content

Listings Module - Custom Where


Rik Brown

Recommended Posts

I can currently display a list of recently modified city listings on sidebar pages of our site using the Listings Module. It uses a CUSTOM ORDER BY (Listing.modified DESC).

That is very quick and works well.

PROBLEM:

In conjunction with a listing from our cities category, I'd like to first do something similar. That would be to display related cities from the same region or country that have likewise been modified recently. So if displaying the listing for the city of Paris, it would show a sidebar list of other European cities (jr_region = same region) or France (jr_country = same country) that have recently been modified.

(FYI, I'll just do the regions first to quickly cover the world and then do it by countries.)

However, when I add a CUSTOM WHERE (such as Field.jr_region = 'Europe' or Field.jr_country = 'France') things slow down drastically (about 7 seconds for a page load).

Is there anyway around that or is that just the nature of adding a "WHERE" to the MySQL query with a lot of records?

Or is there a better way to accomplish this with speed?

Thanks. -- Rik

Edited by Rik Brown
Link to comment
×
×
  • Create New...