Monday, August 5, 2013

Re: Avoiding huge IDs after deleting data

How can the models be configured to use bigserial? I know I could convert the tables myself, but that is not helpful for distributing the app.

It looks like someone requested that feature three years ago.

https://code.djangoproject.com/ticket/14286


On Mon, Aug 5, 2013 at 5:36 PM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On Mon, Aug 5, 2013 at 4:26 PM, Sean Whalen <whalenster@gmail.com> wrote:
> However, because the Django ORM uses the SERIAL data type to store the IDs
> in the DB; the IDs get larger, even when all existing records have been
> deleted. Eventually, I will run out of key space. What can I do to make
> Django produce smaller ID values?


instead of "producing smaller ID values" (which could potentially
collide if you decide to keep a few "old" records), try switching to
bigserial.  even if you get a million requests per day, producing a
billion new records, you won't exhaust the keyspace before several
billion days (almost 50 million years from now)

--
Javier

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/Ro7TOBuBEQg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate