Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.5.0
-
Windows - Couchbase Community Edition 5.5.0 build 2473
Description
Summary: HASH join in N1QL is not supported in Community Edition. Currently, it falls back to Nested Loop silently, which could be frustrating.
Repro:
- Open up Query Workbench in Community Edition (I used build 2473)
- Enter a query that uses HASH join, for instance: SELECT l.name AS landmarkName, h.name AS hotelName, l.email AS landmarkEmail, h.email AS hotelEmail
FROM `travel-sample` l
INNER JOIN `travel-sample` h USE HASH(BUILD) ON h.email = l.email
WHERE l.type = 'landmark'
AND h.type = 'hotel'
limit 10; - Execute query. Or alternatively, click "Plan" or "Plan Text"
Actual:
Query attempts to run, but will likely be very slow and/or timeout because it's falling back to Nested Loop (and there may not be adequate indexing).
Expected/Suggested:
A warning icon shows in the Query Editor when attempting to use HASH join (see screenshot)
and/or
A warning icon shown in the Plan visualization that indicates that a Nested Loop Join is being used because HASH join is not supported in Community.