Subject: | Spurious call to SELECT CONT(*) when accessing result_source.columns from a resultset |
The call from a template to a resultset's result_source.columns
generates a SELECT COUNT( * ) FROM __TABLE__ me:. I set the severity to
"important" because for PostgreSQL, the SELECT COUNT(*) takes as long as
half a second.
$c->stash->{items} =
$c->model('MyApp::Books')->search(undef, {
rows => 3,
}),
[% FOREACH column IN items.result_source.columns %]
<th>[% column %]</th>
[% END %]