I have 2 tables. t1.uuid
has 630,000 distinct values. t2.uuid
has 300,000 distinct values.
When I run
SELECT
t1.uuid
, t2.uuid
FROM
t1 --630,000 uuids
LEFT OUTER JOIN t2 -- 300,000 uuids
ON t1.uuid = t2.uuid
WHERE
t2.uuid IS NULL
There are no results.
Edit1: For clarification: t1 looks like:
uuid |
---|
ufo123 |
abc456 |
def789 |
t2 looks like
uuid |
---|
ufo123 |
def789 |
Every record in t2 has a match in t1. Not every record in t1 has a match in t2 (as indicated by the size of the tables.
I expect the join to result in:
t1.uuid | t2.uuid |
---|---|
ufo123 | ufo123 |
abc456 | NULL |
def789 | def789 |
And the result of my query to by:
t1.uuid | t2.uuid |
---|---|
abc456 | NULL |
But instead I get no results. I'm not sure if there is a communication issue between Redshift and DBEAVER to produce this behavior.
Edit2: I ran the following which resulted in only 300,000 records (same as only t2):
SELECT
COUNT(DISTINCT t1.uuid)
FROM
t1 --630,000 uuids
FULL JOIN t2 -- 300,000 uuids
ON t1.uuid = t2.uuid
This is completely wrong.