Pergunta

This is a general App Engine data store indexing question. The data store automatically build indexes that can be used for simple single property queries (queries that do not involve composite keys).

Does the overhead in generating this index vary on the underlying data type of the entity's property ?

Essentially my question boils down to:

def Person(db.Model):
  name = db.StringProperty()
  rollnumber = db.IntegerProperty()

Is the indexing overhead with respect to the property rollnumber lesser when compared to that of name?

Foi útil?

Solução

The space required to index a value is comprised of:

  • The size of the value itself,
  • If it's variable length, like a string, anywhere from 1 to 3 bytes to store the length of the value
  • The size of the name (eg, 'rollnumber'), plus, again, a few bytes to store the length
  • The size of the entity's key
  • A few extra bytes of overhead

The only surprising thing here should be that the name is stored with every indexed property. This is because there are no statically defined column names - no schema - in the datastore, so it's necessary to store it with every indexed value.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top