We have a MySQL database with very big number of tables. Unfortunately in 2018 we still use Perl CGI. So loading time of a script is essential.
DBIx::Class
was ruled out by me because it loads about 1.6 sec (so long because it loads Perl definitions for all tables of the DB) what is clearly too much.
How quickly Class::DBI
loads? My main question: Does Perl load information about all available tables (like DBIx::Class
does) when we use Class::DBI
or does it load Perl definitions for only these tables which we actually use?
The following is a DBIx::Class
code which loads 1.6 sec:
#!/usr/bin/perl
package MyApp::Schema;
use lib '.../ORMs/dbix-class';
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_namespaces();
1;
(The schema is autogenerated.)
Is there any way to make it faster? How to use it without loading all tables?