Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>You can't.</strong></p> <p>Part of the FAQ states that there is no way you can access beyond row 1000 of a query, increasing the "OFFSET" will just result in a shorter result set, </p> <p>ie: OFFSET 999 --> 1 result comes back. </p> <p>From Wikipedia: </p> <blockquote> <p>App Engine limits the maximum rows returned from an entity get to 1000 rows per Datastore call. Most web database applications use paging and caching, and hence do not require this much data at once, so this is a non-issue in most scenarios.[citation needed] If an application needs more than 1,000 records per operation, it can use its own client-side software or an Ajax page to perform an operation on an unlimited number of rows.</p> </blockquote> <p>From <a href="http://code.google.com/appengine/docs/whatisgoogleappengine.html" rel="nofollow noreferrer">http://code.google.com/appengine/docs/whatisgoogleappengine.html</a></p> <blockquote> <p>Another example of a service limit is the number of results returned by a query. A query can return at most 1,000 results. Queries that would return more results only return the maximum. In this case, a request that performs such a query isn't likely to return a request before the timeout, but the limit is in place to conserve resources on the datastore.</p> </blockquote> <p>From <a href="http://code.google.com/appengine/docs/datastore/gqlreference.html" rel="nofollow noreferrer">http://code.google.com/appengine/docs/datastore/gqlreference.html</a></p> <blockquote> <p>Note: A LIMIT clause has a maximum of 1000. If a limit larger than the maximum is specified, the maximum is used. This same maximum applies to the fetch() method of the GqlQuery class.</p> <p>Note: Like the offset parameter for the fetch() method, an OFFSET in a GQL query string does not reduce the number of entities fetched from the datastore. It only affects which results are returned by the fetch() method. A query with an offset has performance characteristics that correspond linearly with the offset size.</p> </blockquote> <p>From <a href="http://code.google.com/appengine/docs/datastore/queryclass.html" rel="nofollow noreferrer">http://code.google.com/appengine/docs/datastore/queryclass.html</a></p> <blockquote> <p>The limit and offset arguments control how many results are fetched from the datastore, and how many are returned by the fetch() method:</p> <ul> <li><p>The datastore fetches offset + limit results to the application. The first offset results are <strong>not</strong> skipped by the datastore itself.</p></li> <li><p>The fetch() method skips the first offset results, then returns the rest (limit results).</p></li> <li><p>The query has performance characteristics that correspond linearly with the offset amount plus the limit.</p></li> </ul> </blockquote> <h2>What this means is </h2> <p>If you have a singular query, there is no way to request anything outside the range 0-1000. </p> <p>Increasing offset will just raise the 0, so</p> <pre><code>LIMIT 1000 OFFSET 0 </code></pre> <p>Will return 1000 rows, </p> <p>and </p> <pre><code>LIMIT 1000 OFFSET 1000 </code></pre> <p>Will return <strong>0 rows</strong>, thus, making it impossible to, with a single query syntax, fetch 2000 results either manually or using the API. </p> <h2>The only plausible exception</h2> <p>Is to create a numeric index on the table, ie: </p> <pre><code> SELECT * FROM Foo WHERE ID &gt; 0 AND ID &lt; 1000 SELECT * FROM Foo WHERE ID &gt;= 1000 AND ID &lt; 2000 </code></pre> <p>If your data or query can't have this 'ID' hardcoded identifier, then you are <strong>out of luck</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload