Is uniqid() way to long for fast database access?

Codes here !

Moderators: macek, egami, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Is uniqid() way to long for fast database access?

Post by egami » Tue Oct 09, 2012 7:08 am

regardless of what your string is, your table obviously has a "key". Why not use that "Key" since the table already uses it to index. They are unique, and will grow as big is BIGINT can be. (that's big.)

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Is uniqid() way to long for fast database access?

Post by egami » Tue Oct 09, 2012 7:12 am

ie.
The max size of an unsigned integer in MySQL is 4,294,967,295
The max size of an unsigned BIGINT is 18,446,744,073,709,551,615

I'm fairly certain that unless you're Google, Microsoft, Oracle etc.. that the amount of rows you have will never reach BIGINT capabilities.



Enjoy.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest