Subject: | view_definition is being populated on server views |
Date: | Wed, 19 Jul 2017 15:11:18 -0700 |
To: | bug-DBIx-Class [...] rt.cpan.org |
From: | "Francisco Obispo" <francisco [...] obispo.link> |
When using `dbicdump` the resulting `::Result::` package (.pm), contains
the `view_definition` even though it’s a server side view.
This is new behavior, and for server views that are big, the schema is
inflated in size, yielding higher memory usage.
If it’s not a `virtual` view the definition should be omitted, or at
least provide a switch to turn this behavior off.
see:
```perl
__PACKAGE__->table("v_notification_user");
__PACKAGE__->result_source_instance->view_definition(" SELECT
ev.created_date,\n u.id AS user_id,\n u.login AS user_login,\n
a.id AS account_id,\n a.name AS account_name,\n cat.name AS
category_name,\n subcat.name AS subcategory_name,\n subcat.descr
AS subcategory_descr,\n sev.name AS severity_name,\n sev.id AS
severity_id,\n (n.viewed_date IS NOT NULL) AS is_read,\n n.guid,\n
ev.message,\n ev.object,\n ev.url,\n
floor(((date_part('epoch'::text, now()) - date_part('epoch'::text,
ev.created_date)) / (86400)::double precision)) AS age_days,\n
n.website_show\n FROM ((((((notification_event ev\n JOIN
notification n ON ((n.event_id = ev.id)))\n JOIN account a ON ((a.id
= ev.account_id)))\n JOIN \"user\" u ON ((u.id = n.user_id)))\n
JOIN notification_subcategory subcat ON ((ev.subcategory_id =
subcat.id)))\n JOIN notification_category cat ON ((cat.id =
subcat.category_id)))\n JOIN notification_severity sev ON ((sev.id =
ev.severity_id)))");
```
Best regards