GIScience / oshdb

OpenStreetMap History Data Analysis Framework
https://ohsome.org
GNU Lesser General Public License v3.0
110 stars 18 forks source link

Huge filter leads to unresponsive ohsome API #530

Closed matthiasschaub closed 4 months ago

matthiasschaub commented 5 months ago

Bug Description

Sending a request to geometry extraction endpoint with a single small bpoly but a huge filter makes the ohsome API unresponsive.

General Information

Please include the following general information about the issue and list any additional steps needed to reproduce the bug.

bazooka_query.txt

tyrasd commented 4 months ago

The problem with this (extreme) filter is that its large number of or boolean operators makes calculating the disjunctive normal form of the filter (here) extremely inefficient. This computation is done in the optimization phase before executing the query. It would be possible to implement a fail-safe which aborts this particular optimization if the DNF blows up, but as it works fine for filters of "reasonable" complexity, I think it is not really necessary at the moment.