Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread timh

 

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



If you added a new index, then pre-existing items won't be in the index, 
unless it's rebuilt.  Did you add new properties when you added
the projection index ? 

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/jQK08_9rQksJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Christopher Ramírez
No as I remember.

How can I rebuild an Index?

On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:


  

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



 If you added a new index, then pre-existing items won't be in the index, 
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ? 


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Alfred Fuller
App Engine handles index building for you. When you add a new index, it
will re-index all entities.

However, it is possible to save entities with an 'unindexed' property, then
change the model definition to save the same property but 'indexed.' In
this case, the old entities will remain unindexed, while new entities will
be indexed. The only way to fix this is to re-write the old entities (as
switching the indexing of a property is a schema change, and the datastore
does not manage your schema).

On Wed, Jun 20, 2012 at 8:37 AM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 No as I remember.

 How can I rebuild an Index?


 On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:




 I just added a few more records. The new ones appear without trouble.
 Missing records seems to be the ones saved before the projection index was
 created.



 If you added a new index, then pre-existing items won't be in the index,
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ?

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.

 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.


-- 
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-20 Thread Christopher Ramírez
Thanks Alfred! Nice answare.

Now that you point me indexed property, I remember I changed it for some 
fields included in the proyection. Some of them were not indexed before 
been in the proyection. So, that coud be the issue.

On Wednesday, June 20, 2012 10:30:35 AM UTC-6, Alfred Fuller wrote:

 App Engine handles index building for you. When you add a new index, it 
 will re-index all entities.

 However, it is possible to save entities with an 'unindexed' property, 
 then change the model definition to save the same property but 'indexed.' 
 In this case, the old entities will remain unindexed, while new entities 
 will be indexed. The only way to fix this is to re-write the old entities 
 (as switching the indexing of a property is a schema change, and the 
 datastore does not manage your schema).

 On Wed, Jun 20, 2012 at 8:37 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 No as I remember.

 How can I rebuild an Index?


 On Wednesday, June 20, 2012 2:53:12 AM UTC-6, timh wrote:


  

 I just added a few more records. The new ones appear without trouble. 
 Missing records seems to be the ones saved before the projection index was 
 created.



 If you added a new index, then pre-existing items won't be in the index, 
 unless it's rebuilt.  Did you add new properties when you added
 the projection index ? 

  -- 
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/a6RsWljZlHYJ.

 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.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/eeTWsQev-f8J.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Christopher Ramírez
Yes it happens on both servers.

On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually 
 it does not return the last 10 (actually returns fewer and the actual last 
 record is not included). Also the results seems alternated or maybe 
 even/odd are skipped. If I take off projection param, the result is as 
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 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.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/_oXSMPD4KccJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread timh
I haven't used projections in queries, but I was just reading the docs and 
noted the following about indexes.

projectionList or tuple of names of properties to return. Only entities 
possessing the specified properties will be returned. If not specified, 
entire entities are returned by default. Projection 
querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
 are 
faster and cheaper than those that return complete entitites.

*Note:* Specifying this parameter may change the query's index requirements.
Maybe you have added the projection arg and are encountering an index that 
hasn't been rebuilt.  That could be one explanation. 
The other thing to check would be if the missing records have values for 
the properties specified in the projection.

Rgds

T

On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually 
 it does not return the last 10 (actually returns fewer and the actual last 
 record is not included). Also the results seems alternated or maybe 
 even/odd are skipped. If I take off projection param, the result is as 
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 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.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/WmBg8skHXTAJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Christopher Ramírez
Hello Tim!

I checked your the points.

   the missing records have values for the properties specified in the 
 projection. 

Yes, they have. I just even updated them in the datastore admin 
(production) and still don't appear.

 an index that hasn't been rebuilt 

I ran appcfg.py update_indexed and the problem still persists.

Another problem is that I'm specifing a limit of 20 records, but the 
projection query return me only 10 records. Actually, total existing 
instances are 20

I just added a few more records. The new ones appear without trouble. 
Missing records seems to be the ones saved before the projection index was 
created.

On Tuesday, June 19, 2012 7:11:50 PM UTC-6, timh wrote:

 I haven't used projections in queries, but I was just reading the docs and 
 noted the following about indexes.

 projectionList or tuple of names of properties to return. Only entities 
 possessing the specified properties will be returned. If not specified, 
 entire entities are returned by default. Projection 
 querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
  are 
 faster and cheaper than those that return complete entitites.

 *Note:* Specifying this parameter may change the query's index 
 requirements.
 Maybe you have added the projection arg and are encountering an index that 
 hasn't been rebuilt.  That could be one explanation. 
 The other thing to check would be if the missing records have values for 
 the properties specified in the projection.

 Rgds

 T

 On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using 
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But 
 actually it does not return the last 10 (actually returns fewer and the 
 actual last record is not included). Also the results seems alternated or 
 maybe even/odd are skipped. If I take off projection param, the result is 
 as spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10, 
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be 
 used in a different way. Please help me. I would like to use projection 
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 -- 
 You received this message because you are subscribed to the Google 
 Groups Google App Engine group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 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.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/FXLVSDojA1AJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-19 Thread Alfred Fuller
what's your app id?

On Tue, Jun 19, 2012 at 7:59 PM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 Hello Tim!

 I checked your the points.

   the missing records have values for the properties specified in the
 projection.

 Yes, they have. I just even updated them in the datastore admin
 (production) and still don't appear.

  an index that hasn't been rebuilt

 I ran appcfg.py update_indexed and the problem still persists.

 Another problem is that I'm specifing a limit of 20 records, but the
 projection query return me only 10 records. Actually, total existing
 instances are 20

 I just added a few more records. The new ones appear without trouble.
 Missing records seems to be the ones saved before the projection index was
 created.

 On Tuesday, June 19, 2012 7:11:50 PM UTC-6, timh wrote:

 I haven't used projections in queries, but I was just reading the docs
 and noted the following about indexes.

 projection List or tuple of names of properties to return. Only entities
 possessing the specified properties will be returned. If not specified,
 entire entities are returned by default. Projection 
 querieshttps://developers.google.com/appengine/docs/python/datastore/queries#Projection_Queries
  are
 faster and cheaper than those that return complete entitites.

 *Note:* Specifying this parameter may change the query's index
 requirements.
 Maybe you have added the projection arg and are encountering an index
 that hasn't been rebuilt.  That could be one explanation.
 The other thing to check would be if the missing records have values for
 the properties specified in the projection.

 Rgds

 T

 On Tuesday, June 19, 2012 10:35:32 PM UTC+8, Christopher Ramírez wrote:

 Yes it happens on both servers.

 On Monday, June 18, 2012 11:01:08 AM UTC-6, Alfred Fuller wrote:

 Does this happen in both the dev_appserver and production?

 On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
 blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues
 using them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(**limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But
 actually it does not return the last 10 (actually returns fewer and the
 actual last record is not included). Also the results seems alternated or
 maybe even/odd are skipped. If I take off projection param, the result is
 as spected:
 offset_group = Clients.all().order('-__key__'**).fetch(limit=10,
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to
 be used in a different way. Please help me. I would like to use projection
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 --
 You received this message because you are subscribed to the Google
 Groups Google App Engine group.
 To view this discussion on the web visit https://groups.google.com/d/*
 *msg/google-appengine/-/Ahgw_**iP_mukJhttps://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ
 .
 To post to this group, send email to google-appengine@googlegroups.**
 com google-appengine@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscribe@**googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at http://groups.google.com/**
 group/google-appengine?hl=enhttp://groups.google.com/group/google-appengine?hl=en
 .


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/FXLVSDojA1AJ.

 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.


-- 
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.



[google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-18 Thread Christopher Ramírez
I was trying to use projection queries, but I had extrange issues using 
them.

I'm trying to use them like this:
offset_group = Clients.all( \
projection=('name', 'sex', 'birth_date', 'email', 'discount')
).order('-__key__').fetch(limit=10, offset=skip_recs)

The above code is supposed to bring me the last 10 clients. But actually it 
does not return the last 10 (actually returns fewer and the actual last 
record is not included). Also the results seems alternated or maybe 
even/odd are skipped. If I take off projection param, the result is as 
spected:
offset_group = Clients.all().order('-__key__').fetch(limit=10, 
offset=skip_recs)

I do not know if this is a bug in projection queries or they have to be 
used in a different way. Please help me. I would like to use projection 
queries because they are really fast!

Kind Regards,
Christopher Ramírez

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
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.



Re: [google-appengine] Projection Queries does not work with order() and Limit parameter

2012-06-18 Thread Alfred Fuller
Does this happen in both the dev_appserver and production?

On Fri, Jun 15, 2012 at 10:28 AM, Christopher Ramírez 
blindedbythed...@gmail.com wrote:

 I was trying to use projection queries, but I had extrange issues using
 them.

 I'm trying to use them like this:
 offset_group = Clients.all( \
 projection=('name', 'sex', 'birth_date', 'email', 'discount')
 ).order('-__key__').fetch(limit=10, offset=skip_recs)

 The above code is supposed to bring me the last 10 clients. But actually
 it does not return the last 10 (actually returns fewer and the actual last
 record is not included). Also the results seems alternated or maybe
 even/odd are skipped. If I take off projection param, the result is as
 spected:
 offset_group = Clients.all().order('-__key__').fetch(limit=10,
 offset=skip_recs)

 I do not know if this is a bug in projection queries or they have to be
 used in a different way. Please help me. I would like to use projection
 queries because they are really fast!

 Kind Regards,
 Christopher Ramírez

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-appengine/-/Ahgw_iP_mukJ.
 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.


-- 
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.