开发者

Get Total number of records in gae datastore table

开发者 https://www.devze.com 2023-03-31 15:51 出处:网络
How to get the total number of re开发者_运维技巧cords in gae datastore table ? Query result = db.GqlQuery(\"Select * from stocklist ORDER BY part_number\")

How to get the total number of re开发者_运维技巧cords in gae datastore table ?

Query

    result = db.GqlQuery("Select * from stocklist ORDER BY part_number")
    print result.count()

The output will shows 1000 only. But it will contails more than 5000 records. Why?


The count method has a default limit of 1000 which can be overridden.

ex. result.count(99999) will count up to 99,999 records.

The generally accepted best practice here is to use a sharded counter, so that you are doing the bulk of your work during the write operation rather than the read.

0

精彩评论

暂无评论...
验证码 换一张
取 消