Using a slice of the query treated as an iterable is almost certainly
a bad idea.  Try rewriting as:

listings = Listing.all().filter("created <=", str(now)).order('-
created').fetch(10)

On Aug 24, 5:03 pm, Nefarious <mike...@gmail.com> wrote:
> Hi all,
>
> I have an incredibly simple query that looks like this:
>
> listings = Listing.all().filter("created <=", str(now)).order('-
> created')[:10]
>
> Currently, it is looking through about 12 records (and returning up to
> 10), now is a datetime.  This regularly times out!  How can such a
> simple query with almost no data to look through timeout regularly
> (like 50% of the time)?
>
> I thought maybe it was because I didn't create an index for the
> descending situation.  So I added this to index.yaml:
>
> - kind: Listing
>   properties:
>   - name: created
>     direction: desc
>
> But, during upload, I am told this:
>
> Error 400: --- begin server output ---
> Creating a composite index failed: This index:
> entity_type: "Listing"
> ancestor: false
> Property {
>   name: "created"
>   direction: 2
>
> }
>
> is not necessary, since single-property indices are built in. Please
> remove it from your index file and upgrade to the latest version of
> the SDK, if you haven't already.
>
> Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to