Reset ID's auto increment value

32 views
Skip to first unread message

Vincent

unread,
Apr 27, 2009, 12:12:06 PM4/27/09
to Google App Engine
Hi everyone,

I am using a value based on key().id() in an order tracking system.
IDs on my local dev_appser currently start at 0 but IDs on the
production server start at 6000 and get incremented by 1 on insert.

Is there a way to reset the counter so new IDs start at 0?

Nick Johnson

unread,
Apr 28, 2009, 5:09:51 AM4/28/09
to google-a...@googlegroups.com
Hi Vincent,

That's not currently possible, unfortunately. Though it might be
offered in future, it's important to bear in mind that no guarantee of
sequentiality is made for the automatic IDs, only that they'll be
unique. Because your app may run on multiple servers, it's entirely
possible that you'll get IDs out of sequence, or that large ID ranges
will be skipped. If it's important to you that IDs be small, or
sequential, you may want to implement your own assignment scheme.

-Nick Johnson

Sylvain

unread,
Apr 28, 2009, 8:06:34 AM4/28/09
to Google App Engine
Create an index for that.
Check these slides (Building a blog) :
http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine
Reply all
Reply to author
Forward
0 new messages