[Rt-commit] r14883 - rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Wed Aug 6 20:40:53 EDT 2008
Author: ruz
Date: Wed Aug 6 20:40:39 2008
New Revision: 14883
Modified:
rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm
Log:
* if we far behind sample size then select more rows
Modified: rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm (original)
+++ rt/branches/3.6-EXPERIMENTAL-PAGING/lib/RT/Tickets_Overlay.pm Wed Aug 6 20:40:39 2008
@@ -2710,9 +2710,15 @@
sub _OurDoCount {
my $self = shift;
+ my $sample_size = $COUNT_SAMPLE_SIZE;
+ if ( my $page_size = $self->RowsPerPage ) {
+ my $tmp = $self->FirstRow + $page_size;
+ $sample_size = $tmp if $tmp > $sample_size;
+ }
+
my $query_string = do {
local $self->{'first_row'} = 0;
- local $self->{'show_rows'} = $COUNT_SAMPLE_SIZE;
+ local $self->{'show_rows'} = $sample_size;
$self->BuildSelectQuery;
};
@@ -2732,7 +2738,7 @@
$RT::Logger->error("SQL error: ". $records->err) if $records->err;
return $filtered_found
- if $total_found < $COUNT_SAMPLE_SIZE;
+ if $total_found < $sample_size;
my $all_records = $self->SUPER::CountAll;
return undef unless $all_records;
More information about the Rt-commit
mailing list