AppEngine / Datastore: best way to get as ancestor request returns everything recursively

When I do get()with ancestor restriction, it seems that I get all the entities for this ancestor key and all the ancestors for which it is a parent.

In this case, I use ancestral relationships to represent a homogeneous tree (all nodes represented by the same species, each level is immediately matched). All identifiers that I use are unique around the world, and I have a parent identifier written on each object (in addition to being in the path of the ancestor).

Since ancestor search returns too much data (all levels are lower and lower, and not just the nearest level; the documentation does not mention several other eccentrics), I will need to add a filter to make sure that I just go back to current level.

So, the question is, is there a difference in performance to make ancestor().filter()compared to just filter()because they both give the same results for me.

Thank.

+4
source share
1 answer

It is simply filter()ultimately consistent, while ancestor().filter()strongly agreed.

, , .

+4

Source: https://habr.com/ru/post/1655674/


All Articles