Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using overview tables #1030

Open
enekid opened this issue Sep 6, 2018 · 0 comments
Open

Stop using overview tables #1030

enekid opened this issue Sep 6, 2018 · 0 comments
Assignees
Labels

Comments

@enekid
Copy link

enekid commented Sep 6, 2018

Context: [PROJECT] Deprecate raster overviews

Note: Don't merge into master until authorized.

Don't use overviews tables to generate dataviews and maps. Also, in order to maintain performance, Dynamic aggregation has to be enabled for raster tiles (issue).

Main steps:

  • Use regular dataviews factory (non-overviews)

Current - Dataview Factory with Overviews

var DataviewFactoryWithOverviews = require('../models/dataview/overviews/factory');
//...
var dataviewDefinition = getDataviewDefinition(mapConfig.obj(), dataviewName);
//...
pg = new PSQL(dbParamsFromReqParams(params));
var query = getQueryWithFilters(dataviewDefinition, params);
var queryRewriteData = getQueryRewriteData(mapConfig, dataviewDefinition, params);
var dataviewFactory = DataviewFactoryWithOverviews.getFactory(overviewsQueryRewriter, queryRewriteData, {
        bbox: params.bbox
});
dataview = dataviewFactory.getDataview(query, dataviewDefinition);

Proposed - Dataview Factory without Overviews

var DataviewFactory = require('../models/dataview/factory');
//...
var dataviewDefinition = getDataviewDefinition(mapConfig.obj(), dataviewName);
//...
pg = new PSQL(dbParamsFromReqParams(params));
var query = getQueryWithFilters(dataviewDefinition, params);
dataview = DataviewFactory.getDataview(query, dataviewDefinition);
  • Remove MapConfigOverviewsAdapter from adapter list

The api-router creates a list of chained adaptars that transform the original MapConfig. The one related to the overviews is MapConfigOverviewsAdapter. It tries to transform the sql in order to make use of the overviews tables.

        const mapConfigAdapter = new MapConfigAdapter(
            new MapConfigNamedLayersAdapter(templateMaps, pgConnection),
            new MapConfigBufferSizeAdapter(),
            new SqlWrapMapConfigAdapter(),
            new DataviewsWidgetsAdapter(),
            new AnalysisMapConfigAdapter(analysisBackend),
            new VectorMapConfigAdapter(pgConnection),
            new AggregationMapConfigAdapter(pgConnection),
            //new MapConfigOverviewsAdapter(overviewsMetadataBackend, filterStatsBackend),
            new TurboCartoAdapter()
        );
@enekid enekid self-assigned this Sep 6, 2018
@enekid enekid added the Node.js label Sep 6, 2018
@dgaubert dgaubert assigned dgaubert and unassigned enekid Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants