resolve/refinerycms — Issue #1295: Column metadata for slugs loaded dozens of times
Author: sbleon
Created: 2012-02-10 19:31:48+00:00
State: open

In both production and development, I'm seeing the following query being run dozens of times on every page request. I've got config.cache_classes = true, so I'm not sure why this would be getting run more than once.

SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"slugs"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

This is really slowing down the site, with pages taking 3-5 seconds to load on Heroku. We're trying to get this site launched, and need to be able to speed things up!