Blog Sections Open

When Easy2 Gallery Queries Overload the Database

If one gallery module starts dominating MySQL activity, optimize the query pattern before the host turns the database off for you.

This donor included a useful hosting incident: the database was blocked because repeated Easy2 queries were copying to temporary tables and creating critical load.

What the Query Pattern Revealed

The same SELECT DISTINCT query over gallery directories and files repeated over and over for the same category IDs. That usually means the gallery path is doing too much work per request and too little caching.

What to Review First

  • Whether the gallery subtree can be cached more aggressively
  • Whether the query can be reduced or indexed better
  • Whether the same category is rendered repeatedly on one page
  • Whether a lighter gallery strategy would fit the site better

The operational lesson is important: when a host reports “critical load”, capture the actual queries and optimize from evidence. Module choice, query structure, and caching strategy all matter more than guessing.

Newer post

Why eForm Works on Some Pages but Not Others

When eForm sends mail only from selected resources, look beyond SMTP and inspect template structure, parser errors, and page-specific markup differences.

Older post

Serving AJAX Variants with Separate Cache Logic

If one URL needs both a full-page response and an AJAX-only response, treat them as different cache contexts instead of hoping one cache file can safely serve both.