diff --git a/NEWS.md b/NEWS.md index 9c9c0c9e..64305a89 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,17 @@ # Changelog +## 5.3.2 +Released yyyy-mm-dd + - Upgrades Windshaft to 4.5.3 + +## 5.3.1 +Released 2018-02-13 + - Improve the speed of the aggregation dataview #865 + ## 5.3.0 Released 2018-02-12 - Upgrades redis-mpool to 0.5.0 - - Upgrades windshaft to 4.5.1 + - Upgrades windshaft to 4.5.2 - Upgrades cartodb-redis to 0.15.0 - Adds metrics option to the Mapnik renderer - Upgrades camshadft to 0.61.2 diff --git a/lib/cartodb/models/dataview/aggregation.js b/lib/cartodb/models/dataview/aggregation.js index fed5e14e..568d3cc2 100644 --- a/lib/cartodb/models/dataview/aggregation.js +++ b/lib/cartodb/models/dataview/aggregation.js @@ -2,19 +2,17 @@ const BaseDataview = require('./base'); const debug = require('debug')('windshaft:dataview:aggregation'); const filteredQueryTpl = ctx => ` - filtered_source AS ( - SELECT * - FROM (${ctx.query}) _cdb_filtered_source - ${ctx.aggregationColumn && ctx.isFloatColumn ? ` - WHERE - ${ctx.aggregationColumn} != 'infinity'::float - AND - ${ctx.aggregationColumn} != '-infinity'::float - AND - ${ctx.aggregationColumn} != 'NaN'::float` : - '' - } - ) + SELECT * + FROM (${ctx.query}) _cdb_filtered_source + ${ctx.aggregationColumn && ctx.isFloatColumn ? ` + WHERE + ${ctx.aggregationColumn} != 'infinity'::float + AND + ${ctx.aggregationColumn} != '-infinity'::float + AND + ${ctx.aggregationColumn} != 'NaN'::float` : + '' + } `; const summaryQueryTpl = ctx => ` @@ -43,7 +41,7 @@ const rankedCategoriesQueryTpl = ctx => ` ${ctx.column} AS category, ${ctx.aggregationFn} AS value, row_number() OVER (ORDER BY ${ctx.aggregationFn} desc) as rank - FROM filtered_source + FROM (${filteredQueryTpl(ctx)}) filtered_source ${ctx.aggregationColumn !== null ? `WHERE ${ctx.aggregationColumn} IS NOT NULL` : ''} GROUP BY ${ctx.column} ORDER BY 2 DESC @@ -134,7 +132,6 @@ const aggregationFnQueryTpl = ctx => `${ctx.aggregation}(${ctx.aggregationColumn const aggregationDataviewQueryTpl = ctx => ` WITH - ${filteredQueryTpl(ctx)}, ${summaryQueryTpl(ctx)}, ${rankedCategoriesQueryTpl(ctx)}, ${categoriesSummaryMinMaxQueryTpl(ctx)}, diff --git a/package.json b/package.json index 371ccfa9..09bfb4a8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "5.3.0", + "version": "5.3.2", "description": "A map tile server for CartoDB", "keywords": [ "cartodb" @@ -47,7 +47,7 @@ "step-profiler": "~0.3.0", "turbo-carto": "0.20.2", "underscore": "~1.6.0", - "windshaft": "4.5.1", + "windshaft": "4.5.3", "yargs": "~5.0.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 29c0f15f..26f8cc5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2367,9 +2367,9 @@ window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" -windshaft@4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/windshaft/-/windshaft-4.5.1.tgz#1be73b2d81cd8df648423ac219dae27406261aab" +windshaft@4.5.3: + version "4.5.3" + resolved "https://registry.yarnpkg.com/windshaft/-/windshaft-4.5.3.tgz#45e792af06b224f78f44b6eb3b0ecb9d90dcc943" dependencies: "@carto/mapnik" "3.6.2-carto.2" "@carto/tilelive-bridge" cartodb/tilelive-bridge#2.5.1-cdb1