We have a query that looks like this:
SELECT security, count(*)
FROM assets
WHERE
src = 333 AND
account_id in ('15784','15542','15662','15660') AND
effective_date = TO_DATE('20170109','yyyyMMdd' ) AND
security in (10202, 23423, 54564)
GROUP BY security;
This is a pretty simple group by query. The odd thing is that this returns the same security value multiple times. Has anyone ever seen this?
security | count(*) |
10202 | 102 |
23423 | 10 |
54564 | 8 |
10202 | 3 |
23423 | 4 |
54564 | 6 |
10202 | 3 |
23423 | 2 |
54564 | 1 |
Here's the query plan which is what I would expect with the distinct.
PLAN
CLIENT 20-CHUNK PARALLEL 20-WAY POINT LOOKUP ON 675 KEYS OVER ASSETS
SERVER FILTER BY FIRST KEY ONLY
SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [SECURITY]
CLIENT MERGE SORT