[Dbix-class] count behaviour

Alex Povolotsky tarkhil at over.ru
Tue Feb 26 11:23:31 GMT 2008


Hello!

I'm using (with Catalyst and TT) some simple code to count related data

[% FOREACH loc IN llist -%]
<li>[% loc.name %] : (<a href="[% Catalyst.uri_for("edit/$loc.lid") 
%]>Edit</a>)
[% loc.contacts.count+0 %] contacts (more): [% loc.servers.count+0 %] 
servers (more):
here will be traffic
[% END -%]

Debugging SQL requests, I've found that both counts use "select *" 
instead of "select count(*)".

Is it a bug or a feature? Maybe count should be better optimized?

Alex.




More information about the DBIx-Class mailing list