Skip to content

Commit

Permalink
Apply bbox to part of "addresses" query
Browse files Browse the repository at this point in the history
Adding parenthesis around additional conditions allows to use index and prevents from selecting all rows from DB containing "addr:housename" or "addr:unit".
  • Loading branch information
Adrian 'Nexces' Piotrowicz authored and jeisenbe committed Oct 23, 2019
1 parent 05dc392 commit e66889e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ Layer:
tags->'addr:unit' AS addr_unit,
NULL AS way_pixels
FROM planet_osm_point
WHERE way && !bbox! AND ("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL)
WHERE way && !bbox! AND (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL))
ORDER BY way_pixels DESC NULLS LAST
) AS addresses
properties:
Expand Down

0 comments on commit e66889e

Please sign in to comment.