mardi 26 novembre 2019

Rails Application keep heating pg_type and pg_attribute table how to reduse this call

I am using ruby ruby-2.1.2, Rails 4.1.3 with Postgres and we see application keep heating pg_type and pg_attribute table.

How to validate and see who calling this query?

Query 1 : SELECT oid, typname, typelem, typdelim, typinput FROM pg_type
Query 2 :  SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = ?::regclass
                 AND a.attnum > ? AND NOT a.attisdropped
               ORDER BY a.attnum

Aucun commentaire:

Enregistrer un commentaire