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 
> queries<https://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 <
>>> [email protected]> 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 [email protected].
>>>> To unsubscribe from this group, send email to 
>>>> [email protected].
>>>> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to