How should I store a GUID in Oracle?

后端 未结 7 813
无人及你
无人及你 2020-12-08 02:16

I am coming from the SQL server world where we had uniqueidentifier. Is there an equivalent in oracle? This column will be frequently queried so performance is the key.

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 02:38

    There is no uniqueidentifier in Oracle.

    You can implement one yourself by using RAW (kind of a pain) or CHAR. Performance on queries that JOIN on a CHAR field will suffer (maybe as much as 40%) in comparison with using an integer.

    If you're doing distributed/replicated databases, the performance hit is worth it. Otherwise, just use an integer.

提交回复
热议问题