Chameleon
Chameleon

Reputation: 10128

What is maximum size/limitation of ListProperty for Google App Engine datastore?

I am using GAE long time but can not find what is maximum length of ListProperty.

I was read documentation but not found solution I want to create ListProperty(long) to keep about 30 values of long or more. I want use this field as filter - can I use it similar to StringListProperty?

What is size limits of ListProperty(long)?

Upvotes: 5

Views: 3185

Answers (3)

dragonx
dragonx

Reputation: 15143

@marcadian has a pretty good answer. There's no limit specifically on a ListProperty.

You do need to look at datastore limits on entities though: https://developers.google.com/appengine/docs/python/datastore/#Python_Quotas_and_limits

The two most obvious limits are the 1MB maximum entity size and 20000 index entries.

Depending on what's inside your list, it may vary. You can fit 130k 8-byte long's within that 1MB limit, but if they're indexed, you'll hit a barrier at 20k entries because of the index limit.

The worst bit is that these limits are on the total entity size, so if you have two lists in an entity, the size of one list could be limited by the what's in the other list.

Upvotes: 5

marcadian
marcadian

Reputation: 2618

I've a list of 20K strings (not indexed though). I don't think there is limitation on the length, but there is limitation on each entity size. Be careful on indexing multi value properties, it could be expensive.

Upvotes: 3

Dmytro Sadovnychyi
Dmytro Sadovnychyi

Reputation: 6201

30 will be fine.

Guido's answer about related question: https://stackoverflow.com/a/15418435/1279005 So up to 100 repeated values will be fine.

Repeated properties much easier to understand by using NDB as I think. You should try it. It's does not matter if you using it with Long or String properties - if the property is indexed you'll be able to filter by it.

Upvotes: 1

Related Questions