[Dbix-class] Spurious call to SELECT CONT(*) when accessing result_source.columns from a resultset

Dan Dascalescu ddascalescu+dbic at gmail.com
Mon Dec 4 16:29:09 GMT 2006


The call from a template to a resultset's result_source.columns
generates a SELECT COUNT( * ) FROM __TABLE__ me:. 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 %]

Sorry for the vagueness and lack of a test case. I've just gone
through my first DBIC tutorial a few hours ago and through the first
usage of Catalyst with DBIC today. castaway and ash on #dbix-class
confirmed the issue.

Hope that helps,
Vlad Dan Dascalescu

More information about the Dbix-class mailing list