Closed jesusitd closed 4 years ago
Each task to be written in this work plan will be written with the intention of being discussed among us and thus avoid problems when applying them in production.
Workplan:
Date filters applied to:
For some reason this query cannot be pushed:
/* TV 2.0 Documents */
SELECT
documents.`id` AS `document_id`
, documents.`date_entered`
, documents.`date_modified`
, documents.`document_name`
, documents.`status_id`
, documents.`template_type`
, documents_cstm.`aos_pdf_templates_id_c` AS `template_id`
FROM documents
JOIN documents_cstm ON documents.id = documents_cstm.id_c
LEFT JOIN aos_pdf_templates ON documents_cstm.aos_pdf_templates_id_c = aos_pdf_templates.id
AND aos_pdf_templates.deleted = 0
LEFT JOIN aos_pdf_templates_cstm ON aos_pdf_templates.id = aos_pdf_templates_cstm.id_c
AND LEFT(aos_pdf_templates_cstm.template_type_c, 8) = 'retainer'
WHERE
TRUE
AND documents.deleted = 0
AND documents.date_entered >= '2019-01-01 05:00:00'
AND (
LEFT(documents.template_type, 8) = 'retainer'
OR LEFT(aos_pdf_templates_cstm.template_type_c, 8) = 'retainer'
)
;
TV 2.0 improved refresh times performance dramatically, from ~10-15 min down to ~3-5 mins.
I think we were successful with this.
New
Documents
Query for TV 2.0: