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

Skip attribute validation when sql_raw is present #643

Merged
merged 1 commit into from
Jul 19, 2018

Conversation

jgoizueta
Copy link
Contributor

This is a quick fix for #639

sql_raw presence indicates aggregation or other complex query wrapping is in place.
In these cases running a query with a whole-earth bbox as the attribute validation does can be very expensive (even with LIMIT 1, because the whole table must first be aggregated).

So here we avoid the problematic attribute validation altogether when sql_raw is present.
In particular, notice that:

  • If no aggregations or other sql wrapping occurs, no sql_raw is present and validation is not skipped
  • If aggregations are requested but they are not being applied (too few rows or wrong geometry type) sql_raw is also empty and validation is not skipped

We'll work on a better solution in #642

sql_raw prsence indicates aggregation or other complex query wrapping is in place.
In these cases running a query with a whole-earth bbox as the attribute validation does,
even with LIMIT 1 can be very expensive.

Fixes #639
@jgoizueta jgoizueta requested review from dgaubert and enekid July 18, 2018 10:25
@jgoizueta
Copy link
Contributor Author

Hey guys, I've been testing this in staging and it seems to work fine, So I'll release it

@jgoizueta jgoizueta merged commit c056ed2 into master Jul 19, 2018
@jgoizueta jgoizueta deleted the 639-aggregation-validation branch July 19, 2018 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants