0

I want to use UUID as a primary key for one of my very high volume tables in Apache Derby. Per Derby docs, I should be using CHAR(16) FOR BIT DATA. My question is: since this is a binary column and it does not support sorting how are indexes ordered and managed? I read explanations on how defragmentation occurs when out of order entries are added - so with binary PK since there is no sorting, won't entries get added to index page one after another? And in that case how are indexes managed/ordered by the db engine? What am I missing here? Can I use and index binary storing UUID?

I referred these links: http://kccoder.com/mysql/uuid-vs-int-insert-performance/ and How should I use UUID with JavaDB/Derby and JDBC? and http://www.informit.com/articles/article.aspx?p=25862&seqNum=7

Community
  • 1
  • 1
donlys
  • 440
  • 6
  • 13
  • Have you tried it? Why not write some tests and see how it behaves for you? – Bryan Pendleton Dec 16 '16 at 00:16
  • 1
    Adding few outstanding research links with the hope that users will find it useful: 1) https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ 2) http://www.informit.com/articles/article.aspx?p=25862&seqNum=7 3) https://cjsavage.com/guides/mysql/insert-perf-uuid-vs-ordered-uuid-vs-int-pk.html 4) http://www.javafaq.nu/java-article1092.html 5) https://www.codeproject.com/articles/388157/guids-as-fast-primary-keys-under-multiple-database – donlys Dec 28 '16 at 19:13

0 Answers0