Nice detailed investigation, Gerald.
I’m quite puzzled by the situation and I think it comes down to something specific to Postgres (and not SonarQube).
I’m not an expert of Postgres in particular, but I got this totally wild idea: have you rebuilt your indices since you upgraded to Postgre 10?
Except for some specificity of equals operator on varchar with “-” character with Postgre 10 (of which I have found no trace of so far), the only explanation that comes to my mind for this difference in behavior of “=” compared to “like” is that the former is going to use the index on column UUID while the later isn’t and will do a full sequential scan of the table.
If the index is corrupted for any reason, then the result may differ.