QueryLimiter counts Rails schema loads against quota

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

I was trying to see why https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/65261765 failed, and it looks to me that the QueryLimiter also counts these queries against the quota:

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 = '"redirect_routes"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

These are Rails table schema loads and can easily add 10-20 more queries to the test and cause the example to exceed the threshold. It also makes specs fail if you run them in isolation.

Maybe we should exclude any queries that includes FROM pg_attribute?

/cc: @yorickpeterse

Edited Sep 13, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading