diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 2c62977f3..301e4ac35 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -162,14 +162,12 @@ module.exports = Self => { const stmts = []; let stmt; - - stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.filter'); - + stmts.push(`SET @_optimizer_search_depth = @@optimizer_search_depth`); stmts.push(`SET SESSION optimizer_search_depth = 0`); stmt = new ParameterizedSQL(` - CREATE TEMPORARY TABLE tmp.filter + CREATE OR REPLACE TEMPORARY TABLE tmp.filter (PRIMARY KEY (id)) ENGINE = MEMORY SELECT t.id,