slow queries #3

Closed
opened 2011-07-26 14:51:13 +00:00 by mjgardner · 2 comments
mjgardner commented 2011-07-26 14:51:13 +00:00 (Migrated from github.com)

From Josh at Shutterstock:

I'm seeing a few really slow queries being generated from the code. They look like this:

SELECT * FROM TABLENAME WHERE ( 1 = 0 )

From Josh at Shutterstock: > I'm seeing a few really slow queries being generated from the code. They look like this: > > `SELECT * FROM TABLENAME WHERE ( 1 = 0 )`
mjgardner commented 2011-07-26 18:18:05 +00:00 (Migrated from github.com)

I've traced that particular query to &DBIx::Class::Schema::Loader::DBI::_table_columns, which is used to discover table column names. I assume that most of the other slow queries will have a similar rationale.

One way to speed things up is to pass a pre-existing DBIx::Class::Schema instead of a DSN and login information. Right now the only way to do that is in code; I'll work on an update to pass a class name from the command line.

I've traced that particular query to &DBIx::Class::Schema::Loader::DBI::_table_columns, which is used to discover table column names. I assume that most of the other slow queries will have a similar rationale. One way to speed things up is to pass a pre-existing DBIx::Class::Schema instead of a DSN and login information. Right now the only way to do that is in code; I'll work on an update to pass a class name from the command line.
mjgardner commented 2011-07-26 22:00:24 +00:00 (Migrated from github.com)

As of 7aa8bf7 you can now use the --class_name option (or constructor parameter) to point to an existing DBIx::Class::Schema.

As of 7aa8bf7 you can now use the `--class_name` option (or constructor parameter) to point to an existing DBIx::Class::Schema.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mjg/perl-App-DBCritic#3
No description provided.