Improved zig-zag query planner in GAE SDK 1.6

17 views
Skip to first unread message

Emanuele Ziglioli

unread,
Nov 9, 2011, 4:46:02 PM11/9/11
to Siena
Hi,

am just experimenting with GAE SDK 1.6 to see whether I could use the
new query planner, see this article: http://code.google.com/appengine/articles/indexselection.html

It's not working for me.

class Event extends Model
{
public Tag tag;
public Project project;
public Date timestamp;
}

class Project extends Model
{
@Owned(mappedBy="project"
public Many<Event> events;
}

This is my query:
Project prj;
...
prj.events.order("tag").order("-timestamp").fetch();

Originally I had a complex index:

<datastore-index kind="Event" ancestor="false" source="manual">
<property name="project" direction="asc"/>
<property name="tag" direction="asc"/>
<property name="timestamp" direction="desc"/>
</datastore-index>

I've tried to replace it with two simple indexes:

<datastore-indexes authoGenerate = "false >
<datastore-index kind="Event" ancestor="false">
<property name="tag" direction="asc"/>
<property name="timestamp" direction="desc"/>
</datastore-index>
<datastore-index kind="Event" ancestor="false">
<property name="project" direction="asc"/>
<property name="timestamp" direction="desc"/>
</datastore-index>
<datastore-indexes />

but I still get the error:
Error: Query
com.google.appengine.api.datastore.dev.LocalCompositeIndexManager
$IndexComponentsOnlyQuery@8f5af10c requires a composite index that is
not defined

Has anyone had success getting rid of complex indexes with the new SDK?

Emanuele Ziglioli

unread,
Nov 9, 2011, 4:53:51 PM11/9/11
to Siena
Correction, it now works, bizarre!


On Nov 10, 10:46 am, Emanuele Ziglioli <theb...@emanueleziglioli.it>
wrote:

Pascal Voitot Dev

unread,
Nov 9, 2011, 5:01:57 PM11/9/11
to siena-...@googlegroups.com
You could ask to Google App Engine list directly, don't you think?

Pascal


--
You received this message because you are subscribed to the Google Groups "Siena" group.
To post to this group, send email to siena-...@googlegroups.com.
To unsubscribe from this group, send email to siena-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siena-discuss?hl=en.


Emanuele Ziglioli

unread,
Nov 9, 2011, 5:44:12 PM11/9/11
to Siena
Yes, I've posted a message there:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/2b72426cb03c0c6b

Now, it's even more weird.
1. I've realized that when I upgraded my project in Eclipse showed it
was using the new SDK but the jars under WEB-INF/lib hadn't been
updated automatically. I believe I was using still SDK 1.5.5 so that
query shouldn't have worked
2. Now I've manually copied the new SDK jars, and while the query
failed initially, it started working after a little bit
3. Now that query works if I fetch 120 rows, but it fails when I fetch
100! and it reports that index error. It smells fishy!

On Nov 10, 11:01 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Pascal Voitot Dev

unread,
Nov 9, 2011, 5:54:16 PM11/9/11
to siena-...@googlegroups.com
On Wed, Nov 9, 2011 at 11:44 PM, Emanuele Ziglioli <the...@emanueleziglioli.it> wrote:
Yes, I've posted a message there:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/2b72426cb03c0c6b

Now, it's even more weird.
1. I've realized that when I upgraded my project in Eclipse showed it
was using the new SDK but the jars under WEB-INF/lib hadn't been
updated automatically. I believe I was using still SDK 1.5.5 so that
query shouldn't have worked
2. Now I've manually copied the new SDK jars, and while the query
failed initially, it started working after a little bit
3. Now that query works if I fetch 120 rows, but it fails when I fetch
100! and it reports that index error. It smells fishy!


it smells zigzag :D
 
Reply all
Reply to author
Forward
0 new messages