Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Performance of primary key IDs with gaps (but in sequential order)

$
0
0

I know that having non-sequential IDs is bad for index performance. But assuming all my IDs are created in correct order, but with large gaps: i.e:

154300000
283700000
351300000
464200000

…will the performance be any worse than having gapless auto_increment IDs?

I’ll be using MySQL, or perhaps PostgreSQL. The gaps between the IDs would not be even. They’ll be BIGINTs with a unix timestamp at the start (left side) of the number, and the rest of the numbers mostly being random, as discussed in another question I asked here:

http://stackoverflow.com/questions/6338956/mysql-primary-keys-uuid-guid-vs-bigint-timestamprandom/6339581


Viewing all articles
Browse latest Browse all 1138