← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ddd2.pl
  Run on Tue May 25 16:52:24 2010
Reported on Tue May 25 16:57:04 2010

File /project/perllib/Wiki/DB/Wiki.pm
Statements Executed 13
Statement Execution Time 1.05ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sWiki::DB::Wiki::::BEGINWiki::DB::Wiki::BEGIN
0000s0sWiki::DB::Wiki::::get_full_nameWiki::DB::Wiki::get_full_name
0000s0sWiki::DB::Wiki::::update_updated_onWiki::DB::Wiki::update_updated_on
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Wiki::DB::Wiki;
23698µs1466msuse base qw(K2::DB2);
# spent 466ms making 1 call to base::import
3
4144µs1401ms__PACKAGE__->set_up_table('t_wiki');
# spent 401ms making 1 call to Class::DBI::Pg::set_up_table
5144µs1193µs__PACKAGE__->sequence('t_wiki_id_seq');
6
7125µs1114ms__PACKAGE__->has_a_datetime('updated_on');
# spent 114ms making 1 call to K2::DB2::has_a_datetime
8137µs147.6ms__PACKAGE__->has_many(categories => 'Wiki::DB::WikiCategories', 'wiki_id');
# spent 47.6ms making 1 call to Class::DBI::__ANON__[Class/DBI.pm:1034]
9138µs12.38ms__PACKAGE__->has_many(wikis => 'Wiki::DB::WikiCategories', 'category_id', { order_by => 'view_order' } );
# spent 2.38ms making 1 call to Class::DBI::__ANON__[Class/DBI.pm:1034]
10130µs1216µs__PACKAGE__->retrieve_all_sort_field('updated_on desc');
11131µs1182µs__PACKAGE__->add_trigger(before_update => \&update_updated_on);
# spent 182µs making 1 call to Class::DBI::add_trigger
12
13
14sub get_full_name {
15 my ($self) = @_;
16 my $c = $self->categories->first;
17 my $name = $c ? $c->category_id->get_full_name . ' - ' : '';
18 $name .= $self->title;
19 return $name;
20}
21
22
23sub update_updated_on {
24 my ($self) = @_;
25 $self->updated_on(time);
26}
27
28
29131µs1589µs__PACKAGE__->set_sql(parent_category => <<'');
# spent 589µs making 1 call to Class::DBI::set_sql
30SELECT * FROM __TABLE__
31WHERE id IN ( SELECT distinct category_id FROM t_wiki_categories)
32ORDER BY title
33
34
35129µs1429µs__PACKAGE__->set_sql(category => <<'');
# spent 429µs making 1 call to Class::DBI::set_sql
36SELECT * FROM __TABLE__
37WHERE id IN ( SELECT distinct category_id FROM t_wiki_categories
38 WHERE category_id IN (SELECT distinct category_id FROM t_wiki_categories) AND
39 category_id NOT IN (SELECT distinct wiki_id FROM t_wiki_categories))
40ORDER BY title
41
42
43141µs1;