google app engine - GQL Query Optimization and Table Architecture -
I am working with Google App Engine and with some of my data queries I am running in some slow performance. Designing an Epe Engine Datastore is a different mentality than working with SQL Database and I'm not sure I'm doing this the best way. I have two questions to get on the right track:
Specifically:
I have a Foo
type and Type a UserFoo
. There is an "example" of each UserFoo
related foo
and holds specific data for that example. My foo
type has a fooCode
property that is a unique identifier and I can assign each UserFoo
to each foo
I can map them using their fooCode
properties. I then work with Fu on each code:
foos = Foo.all (). Foo filter for foo ('bar =', bar): userFoo = UserFoo.all () .filter ('userKey =', user) .filter ('fooCode =', foo.fooCode)
Note: I'm using fooCode
on a reference key so that we can easily remove the new Foo
s and add it again and its After all the compatible UserFoo
s
In general:
GAE datastore tables and designing best practices for using them What are the specific perspectives for?
This anti-pattern is the solution.
In this way it is that you have decided not to use any reference property. I would advise you to reconsider this option.
Note: I am using fooCode on a reference key so that we can easily remove new fuses and add it again, and then all the corresponding userfos.
Remember that a unit key is only an encoded representation of its path: the type of entity and name or id and any of its ancestors. If you have removed and then recreated Foo
, then there will be only one different key if it has been given a different name or id if you have the old and new unit same fooCode
, you can easily use fooCode
as the key name, which will be allowed to be deleted to maintain its original key Added again Foo
.
Comments
Post a Comment