Original query:

david=# SELECT DISTINCT v
david-# FROM (VALUES ('1.2.1'::SEMVER), ('1.2.1-RC1')) AS v(v);
     v     
-----------
 1.2.1-RC1
 1.2.1
(2 rows)

Time: 0.818 ms
david=# explain SELECT DISTINCT v                                                           FROM (VALUES ('1.2.1'::SEMVER), ('1.2.1-RC1')) AS v(v);
                                QUERY PLAN                                
--------------------------------------------------------------------------
 Unique  (cost=0.04..0.04 rows=2 width=32)
   ->  Sort  (cost=0.04..0.04 rows=2 width=32)
         Sort Key: "*VALUES*".column1
         ->  Values Scan on "*VALUES*"  (cost=0.00..0.03 rows=2 width=32)
(4 rows)