duckdb / duckdb/duckdb-spatial

Spatial predicates impacts other filter values

Open
#523 3 comments 0 reactions 0 assignees View on GitHub
under review
Dominant language
C
Stars
708
Forks
96
Avg merge
1d 21h
Merged PRs (30d)
5

Description

Hi
Here is a pretty straightforward SQL query :
```
SELECT d.fidji_valeur_fonciere__integer
FROM dvf.disposition d
WHERE d.fidji_valeur_fonciere__integer < 50000
ORDER BY d.fidji_valeur_fonciere__integer DESC ;
```
with a pretty straightforward result starting with values at 49,999

If I add a spatial filter (either Intersects, Overlaps or contains) I get different results :

```
SELECT d.fidji_valeur_fonciere__integer
FROM dvf.disposition d
WHERE d.fidji_valeur_fonciere__integer < 50000
AND ST_Intersects(ST_MakeEnvelope(1.526264074441798, 45.15464025455313, 1.5394900973676613, 45.16297435294794), d.geom)
ORDER BY d.fidji_valeur_fonciere__integer DESC ;
```

now the results start with a 65500 value, not respecting the d.fidji_valeur_fonciere__integer < 50000 clause.
If I remove the d.fidji_valeur_fonciere__integer < 50000 clause, I have even bigger results as expected.
But it's like using the spatial function thwarts the other filter from being executed totally....

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.