Revision 63f2cbc1
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
my $report_id = $params{report_id} || $::form->{id};
|
||
|
||
$self->{report} = SL::DB::Manager::CsvImportReport->find_by(id => $report_id);
|
||
my $num_rows = SL::DB::Manager::CsvImportReportRow->get_all_count(query => [ csv_import_report_id => $report_id ]);
|
||
my $num_rows = $self->{report}->numrows;
|
||
my $num_cols = SL::DB::Manager::CsvImportReportRow->get_all_count(query => [ csv_import_report_id => $report_id, row => 0 ]);
|
||
|
||
# manual paginating, yuck
|
||
... | ... | |
$pages->{cur} = $page < 1 ? 1
|
||
: $page > $pages->{max} ? $pages->{max}
|
||
: $page;
|
||
$pages->{common} = SL::DB::Helper::Paginated::make_common_pages($pages->{cur}, $pages->{max});
|
||
$pages->{common} = [ grep { $_->{visible} } @{ SL::DB::Helper::Paginated::make_common_pages($pages->{cur}, $pages->{max}) } ];
|
||
|
||
$self->{display_rows} = [
|
||
0,
|
||
... | ... | |
profile => $clone_profile,
|
||
type => $self->type,
|
||
file => '',
|
||
numrows => scalar @{ $self->data },
|
||
)->save(cascade => 1);
|
||
|
||
my $dbh = $::form->get_standard_dbh;
|
SL/DB/MetaSetup/CsvImportReport.pm | ||
---|---|---|
profile_id => { type => 'integer', not_null => 1 },
|
||
type => { type => 'text', not_null => 1 },
|
||
file => { type => 'text', not_null => 1 },
|
||
numrows => { type => 'integer' },
|
||
],
|
||
|
||
primary_key_columns => [ 'id' ],
|
sql/Pg-upgrade2/csv_import_report_cache.sql | ||
---|---|---|
session_id TEXT NOT NULL,
|
||
profile_id INTEGER NOT NULL REFERENCES csv_import_profiles(id),
|
||
type TEXT NOT NULL,
|
||
file TEXT NOT NULL
|
||
file TEXT NOT NULL,
|
||
numrows INTEGER NOT NULL,
|
||
);
|
||
|
||
CREATE TABLE csv_import_report_rows (
|
||
... | ... | |
);
|
||
|
||
ALTER TABLE csv_import_profiles DROP constraint "csv_import_profiles_name_key";
|
||
|
||
CREATE INDEX "csv_import_report_rows_index_row" ON csv_import_report_rows (row);
|
Auch abrufbar als: Unified diff
Anzahl der Zeilen für den Report cachen un indizieren
Da das auch mal gerne 4mio+ werden dauert das sonst elend lange.