Removed useless NULLIF calls (#1214)
`NULLIF(wikipedia, '') IS NOT NULL` replaced by `wikipedia <> ''` https://stackoverflow.com/questions/23766084/best-way-to-check-for-empty-or-null-value
This commit is contained in:
@@ -33,7 +33,7 @@ FROM (
|
||||
slice_language_tags(hl.tags) AS tags,
|
||||
rm1.network_type,
|
||||
CASE
|
||||
WHEN rm1.network_type IS NOT NULL AND nullif(rm1.ref::text, '') IS NOT NULL
|
||||
WHEN rm1.network_type IS NOT NULL AND rm1.ref::text <> ''
|
||||
THEN rm1.ref::text
|
||||
ELSE NULLIF(hl.ref, '')
|
||||
END AS ref,
|
||||
@@ -58,7 +58,7 @@ FROM (
|
||||
LEFT OUTER JOIN osm_route_member rm5 ON rm5.member = hl.osm_id AND rm5.concurrency_index=5
|
||||
LEFT OUTER JOIN osm_route_member rm6 ON rm6.member = hl.osm_id AND rm6.concurrency_index=6
|
||||
WHERE (hl.name <> '' OR hl.ref <> '' OR rm1.ref <> '' OR rm1.network <> '')
|
||||
AND NULLIF(hl.highway, '') IS NOT NULL
|
||||
AND hl.highway <> ''
|
||||
) AS t;
|
||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_network_osm_id_idx ON osm_transportation_name_network (osm_id);
|
||||
CREATE INDEX IF NOT EXISTS osm_transportation_name_network_name_ref_idx ON osm_transportation_name_network (coalesce(name, ''), coalesce(ref, ''));
|
||||
@@ -338,7 +338,7 @@ BEGIN
|
||||
slice_language_tags(hl.tags) AS tags,
|
||||
rm.network_type,
|
||||
CASE
|
||||
WHEN rm1.network_type IS NOT NULL AND nullif(rm1.ref::text, '') IS NOT NULL
|
||||
WHEN rm1.network_type IS NOT NULL AND rm1.ref::text <> ''
|
||||
THEN rm1.ref::text
|
||||
ELSE NULLIF(hl.ref, '')
|
||||
END AS ref,
|
||||
@@ -355,7 +355,7 @@ BEGIN
|
||||
hl.osm_id = c.osm_id
|
||||
LEFT OUTER JOIN osm_route_member rm ON rm.member = hl.osm_id AND rm.concurrency_index=1
|
||||
WHERE (hl.name <> '' OR hl.ref <> '')
|
||||
AND NULLIF(hl.highway, '') IS NOT NULL
|
||||
AND hl.highway <> ''
|
||||
) AS t;
|
||||
|
||||
-- noinspection SqlWithoutWhere
|
||||
|
||||
Reference in New Issue
Block a user