Open at055612 opened 6 years ago
What is the expected outcome from executing select STRM_ID, STRM_ATR_KEY_ID, count(*) from STRM_ATR_VAL group by 1,2 having count(*) > 0;
?
Are you looking for count(*)'s > 1?
In one small Stroom instance,
select STRM_ID, STRM_ATR_KEY_ID, count(*) from STRM_ATR_VAL group by 1,2 having count(*) > 0;
returns 1092812 rows and
select STRM_ID, STRM_ATR_KEY_ID, count(*) from STRM_ATR_VAL group by 1,2 having count(*) > 1;
return 0.
sorry, that > 0
was my mistake. I was just testing the query locally and set it to zero to ensure it returned what I though. It should indeed be > 1
. Thanks for checking.
Fine.
I also tested some other larger installations with > 1 and they also returned 0.
Currently the table will allow multiple attribute values for the same stream and key. The existing index on STRM_ID could be replaced by this unique key as STRM_ID if STRM_ID is kept at the front of the compound index.
Worth running
select STRM_ID, STRM_ATR_KEY_ID, count(*) from STRM_ATR_VAL group by 1,2 having count(*) > 1;
in existing environments to check if any duplicates have been stored.Need to be cautious here as STRM_ATR_VAL is a MASSIVE table so dropping and creating an index will have big implications in terms of additional index storage and migration time.