[google-appengine] Disable billing error

2014-07-25 Thread Plumo
Hello,

I want to delete an old app. I disabled it but the disable billing button 
returns:

Server Error
A server error has occurred.

Any ideas? 

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Datastore Admin - Blank screen

2014-07-25 Thread Aswath Satrasala
Datastore Admin in the Admin console does not showup.
I got the url from the iframe, and pasted in the new tab.  It shows a blank
screen (Empty body).  It takes a very long time to show the blank screen
also.

After trying 5-10 times, the datastore admin shows up occasionally

Any suggestions or workarounds.

-Aswath

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Datastore Admin - Blank screen

2014-07-25 Thread Aswath Satrasala
I looked at the logs for the built in version 'ah-builtin-python-bundle'.
I am trying to open the Datastore Admin using the frontend F1  instance.

   1. 2014-07-25 17:46:01.567
   /_ah/datastore_admin/?app_id=s~accountingguru-indiaadminconsolecustompage
   500 40027ms 0kb Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101
   Firefox/30.0 module=default version=ah-builtin-python-bundle

   122.167.206.119 - aswath.satrasala [25/Jul/2014:05:16:01 -0700]
GET /_ah/datastore_admin/?app_id=s~accountingguru-indiaadminconsolecustompage
HTTP/1.1 500 124 - Mozilla/5.0 (Windows NT 6.1; rv:30.0)
Gecko/20100101 Firefox/30.0
ah-builtin-python-bundle-dot-accountingguru-india.appspot.com
ms=40028 cpu_ms=17419 cpm_usd=0.14 app_engine_release=1.9.7
trace_id=bd242a2ec0efba1137da3c8c040473f1
instance=00c61b117c6eb37c80c3cff7778055047c08e148
https://appengine.google.com/instances?app_id=s~accountingguru-indiaversion_id=ah-builtin-python-bundle.358321112058963634key=00c61b117c6eb37c80c3cff7778055047c08e148#00c61b117c6eb37c80c3cff7778055047c08e148


The API call datastore_v3.RunQuery() took too long to respond and was cancelled.
Traceback (most recent call last):
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py,
line 714, in __call__
handler.get(*groups)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 203, in get
self.RouteAction(GET_ACTIONS)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 195, in RouteAction
self.ListActions(error=self.request.get('error', None))
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 157, in ListActions
kinds, more_kinds = self.GetKinds()
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 222, in GetKinds
kinds, more_kinds = self.GetKindsForAllNamespaces(deadline)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 278, in GetKindsForAllNamespaces
ReadFromKindIters(kind_iter_list)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
line 255, in ReadFromKindIters
kind_name = kind_iter.next().kind_name
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/db/__init__.py,
line 2326, in next
return self.__model_class.from_entity(self.__iterator.next())
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
line 2934, in next
next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
line 2820, in next_batch
batch = self.__next_batch.get_result()
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py,
line 612, in get_result
return self.__get_result_hook(self)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
line 2553, in __query_result_hook
self._batch_shared.conn.check_rpc_success(rpc)
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py,
line 1331, in check_rpc_success
rpc.check_success()
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py,
line 578, in check_success
self.__rpc.CheckSuccess()
  File 
/base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_rpc.py,
line 133, in CheckSuccess
raise self.exception
DeadlineExceededError: The API call datastore_v3.RunQuery() took too
long to respond and was cancelled.


-Aswath



On Fri, Jul 25, 2014 at 5:38 PM, Aswath Satrasala 
aswath.satras...@gmail.com wrote:

 Datastore Admin in the Admin console does not showup.
 I got the url from the iframe, and pasted in the new tab.  It shows a
 blank screen (Empty body).  It takes a very long time to show the blank
 screen also.

 After trying 5-10 times, the datastore admin shows up occasionally

 Any suggestions or workarounds.

 -Aswath


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Datastore Admin - Blank screen

2014-07-25 Thread Aswath Satrasala
Sorry, I meant, I am using F4 instance, not F1 instance.

-Aswath


On Fri, Jul 25, 2014 at 5:52 PM, Aswath Satrasala 
aswath.satras...@gmail.com wrote:

 I looked at the logs for the built in version 'ah-builtin-python-bundle'.
   I am trying to open the Datastore Admin using the frontend F1  instance.

1. 2014-07-25 17:46:01.567
/_ah/datastore_admin/?app_id=s~accountingguru-indiaadminconsolecustompage
500 40027ms 0kb Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101
Firefox/30.0 module=default version=ah-builtin-python-bundle

122.167.206.119 - aswath.satrasala [25/Jul/2014:05:16:01 -0700] GET 
 /_ah/datastore_admin/?app_id=s~accountingguru-indiaadminconsolecustompage 
 HTTP/1.1 500 124 - Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 
 Firefox/30.0 ah-builtin-python-bundle-dot-accountingguru-india.appspot.com 
 ms=40028 cpu_ms=17419 cpm_usd=0.14 app_engine_release=1.9.7 
 trace_id=bd242a2ec0efba1137da3c8c040473f1 
 instance=00c61b117c6eb37c80c3cff7778055047c08e148 
 https://appengine.google.com/instances?app_id=s~accountingguru-indiaversion_id=ah-builtin-python-bundle.358321112058963634key=00c61b117c6eb37c80c3cff7778055047c08e148#00c61b117c6eb37c80c3cff7778055047c08e148


 The API call datastore_v3.RunQuery() took too long to respond and was 
 cancelled.
 Traceback (most recent call last):
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py,
  line 714, in __call__
 handler.get(*groups)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 203, in get
 self.RouteAction(GET_ACTIONS)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 195, in RouteAction
 self.ListActions(error=self.request.get('error', None))
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 157, in ListActions
 kinds, more_kinds = self.GetKinds()
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 222, in GetKinds
 kinds, more_kinds = self.GetKindsForAllNamespaces(deadline)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 278, in GetKindsForAllNamespaces
 ReadFromKindIters(kind_iter_list)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/datastore_admin/main.py,
  line 255, in ReadFromKindIters
 kind_name = kind_iter.next().kind_name
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/ext/db/__init__.py,
  line 2326, in next
 return self.__model_class.from_entity(self.__iterator.next())
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
  line 2934, in next
 next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
  line 2820, in next_batch
 batch = self.__next_batch.get_result()
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py,
  line 612, in get_result
 return self.__get_result_hook(self)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_query.py,
  line 2553, in __query_result_hook
 self._batch_shared.conn.check_rpc_success(rpc)
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py,
  line 1331, in check_rpc_success
 rpc.check_success()
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py,
  line 578, in check_success
 self.__rpc.CheckSuccess()
   File 
 /base/data/home/runtimes/python/python_lib/versions/1/google/appengine/api/apiproxy_rpc.py,
  line 133, in CheckSuccess
 raise self.exception
 DeadlineExceededError: The API call datastore_v3.RunQuery() took too long to 
 respond and was cancelled.


 -Aswath



 On Fri, Jul 25, 2014 at 5:38 PM, Aswath Satrasala 
 aswath.satras...@gmail.com wrote:

 Datastore Admin in the Admin console does not showup.
 I got the url from the iframe, and pasted in the new tab.  It shows a
 blank screen (Empty body).  It takes a very long time to show the blank
 screen also.

 After trying 5-10 times, the datastore admin shows up occasionally

 Any suggestions or workarounds.

 -Aswath




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit 

[google-appengine] Re: ndb, get_by_id can not get an entity with a parent key only by id?

2014-07-25 Thread saintthor
how many entities is in your db? how many ops cost for one call?

在 2014年7月25日星期五UTC+8上午8时03分44秒,Jay写道:

 I wrote a simple test app that used both the db and ndb api and deployed 
 it to app engine. Using appstats I confirmed that both RunQuery when 
 getting the list of articles.

 On Wednesday, July 23, 2014 8:03:40 PM UTC-5, Jay wrote:

 I refer you to line 3865 of __init__ in the ext.db package in the sdk. 
 This is on a _ReverseReferenceProperty that gets setup.
 If I have time tomorrow I will write a quick test to demonstrate.

 On Wednesday, July 23, 2014 11:11:31 AM UTC-5, saintthor wrote:

 are you sure?

 i tested in two apps. the first is using query. when i do a query, the 
 read ops increases about 300. the second is using referenceproperty as 
 above, after 5 times showing, there is no obviously increase.

 the articles in the second app is much more than the first. so i don't 
 think it run a query.

 在 2014年7月22日星期二UTC+8下午11时20分14秒,Jay写道:

 When you use that api in db, it is doing a query underneath the covers.

 On Monday, July 21, 2014 11:27:08 PM UTC-5, saintthor wrote:

 in db, i set such a property in model article:

 auth = db.ReferenceProperty( author, collection_name=AuthSet )


 and use author.AuthSet to get all articles written by the certain 
 author. there is no query. how can i do the same thing in ndb?


 在 2014年7月22日星期二UTC+8上午3时55分28秒,Jay写道:

 Responding to your first post ... that is right. The parent key is 
 part of the entity's key. When you use get_by_id, this is just shorthand 
 for Key('Foo', 99).get().
 You cannot get an entity by key unless you know the key, the whole 
 key. 

 You say you don't want to query, but your use case ... give me all 
 articles for user A ... sounds like a query. 
 articles = Article.query(Article.author == user_key)...

 If you want to do something like most recent n articles then you 
 can store those keys in a 'secondary index' of sorts and use 
 ndb.get_multi()

 On Monday, July 21, 2014 8:11:20 AM UTC-5, saintthor wrote:

 to query may cost too many ops. i don't query.



 在 2014年7月21日星期一UTC+8下午8时53分29秒,Kaan Soral写道:

 Not associated with google, also not an expert on ndb

 As far as I know key groups are related with consistency, in my 
 opinion, you shouldn't put article's and author's in the same group, 
 there 
 is a 1/s write speed limit on entity groups, if you put them in the 
 same 
 entity group, you could hit this limit more easily

 You don't even have to use referenceproperty's - I would just put 
 the author key in an article StringProperty named author and query 
 for 
 it, if I were you



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: I updated Google Eclipse Plugin to 3.6.0 and then could NOT deploy due to size limit of 150MB

2014-07-25 Thread Terry Parker


On Thursday, July 17, 2014 8:54:02 PM UTC-7, Rodrigo Teixo wrote:

 Hi All,

 After I updated from Google Eclipse Plugin from 3.4.2 to 3.6.0, it cannot 
 let me deploy. The message error is:
 *Applications are limited to 157286400 bytes of resource files, you have 
 212567564.*

 I backup my eclipse version before de update and I could deploy again with 
 no code alteration.

 Its is very strange cause the staging directory after the end of 
 permutation is about 2.6Mb. Its much more during the compile. 


 I found something very curious searching for a solution for this error. I 
 found the snipet of code of appengine that produces this message in this 
 link:


 http://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/google/appengine/tools/admin/AppVersionUpload.java

 if (resourceTotal  resourceLimits.maxTotalFileSize()) {
   throw new LocalIOException(Applications are limited to 
   + resourceLimits.maxTotalFileSize() +  bytes of resource 
 files, 
   + you have  + resourceTotal + .);
 }

 And on same page looking for how resourceTotal is calculated we see that 
 is the sum of size of files relative to a variable called *basepath*.

 Looking for how this variable is initiated we find out this function:

 private File getBasepath() {
 File path = app.getStagingDir();
 if (path == null) {
   path = new File(app.getPath());
 }
 return path;
 }

 Look that it uses the staging directory, but if for some reason could not 
 return it uses de app directory witch in my case, the war directory is much 
 more than 150Mb and I think its my case.

 This code is very strange, cause if the staging directory could not be 
 returned it should gives a error and not make this adjustment that could 
 end in a quota limit.

 I am completed tied in this bug, cause its brings a lot of insecurity if 
 I could not deploy with new updates of google plugin.


 Aditional info:
 1 - That deploy folder is outside of the war directory with the -deploy 
 and -extra parameters.
 2 - I have about 50 jars with total 17Mb in WEB-INF/lib folder. With the 
 jars generated by appengine and gwt it goes to about 68Mb in the 
 WEB-INF/lib folder.
 3 - In my current app, under the versions tab of appengine dashboard the 
 sizes of the deployed versions are all more de 150Mb. (are this the same 
 number of the limit?)
 4 - I updated the latest versions gwt (2.6.0) and appengine(1.9.7) and 
 could deploy normally. I just cant update the Eclipse Plugin to 3.6.0.

 Any help would be very appreciated.
 [],
 Rodrigo.


Hi Rodrigo,

This bug was fixed back in May and should be in the 1.9.7 SDK.  Is the GPE 
configured to use 1.9.7?  See 
https://developers.google.com/eclipse/docs/using_sdks. If you configure the 
GPE to use 1.9.7 but still see this issue let us know. Worst case you can 
launch your configuration that uses GPE 3.4.2, look at which AppEngine SDK 
it is using, and configure your GPE 3.6.0 version to use that SDK.

--Terry

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: ndb, get_by_id can not get an entity with a parent key only by id?

2014-07-25 Thread Vinny P
On Fri, Jul 25, 2014 at 9:26 AM, saintthor saintt...@gmail.com wrote:

 how many entities is in your db? how many ops cost for one call?




Perhaps you could post a test case application demonstrating what you're
seeing and the size/content of your entities? It would make this
conversation flow a bit easier.


-
-Vinny P
Technology  Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Problem with Passive FTP with Appengine

2014-07-25 Thread Vinny P
On Thu, Jul 24, 2014 at 3:24 AM, Fabien Lenoir fabien.len...@wozaik.fr
wrote:

  I am trying to use Appengine (Java) to connect to a ftp server in
 passive mode.
 As you may known, passive mode use 2 simultanous connections : 1 on port
 21, and another on port chosen by the server. The problem I encounter, is
 that the two connections are not done from the same IP, as Appengine Socket
 Api use a load balencer and therefore issues connections with different
 source IPs. The problem with this is that the FTP server simply deny IPs
 that haven't initiated connection on port 21.
 Is there any way to keep the same source IP for successive socket
 connection ?




No, there isn't. The best way would probably be to move your FTP code to an
external server or run it on a managed VM:
https://developers.google.com/appengine/docs/managed-vms/ . By running on a
managed VM you can connect using the same IP (of the hosting machine).


-
-Vinny P
Technology  Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Disable billing error

2014-07-25 Thread Vinny P
On Fri, Jul 25, 2014 at 3:33 AM, Plumo richar...@gmail.com wrote:

  I want to delete an old app. I disabled it but the disable billing
 button returns:
 Server Error

  A server error has occurred.

  Any ideas?



Are you deleting the application through the App Engine console, or the
containing project via the cloud console: cloud.google.com/console ?


-
-Vinny P
Technology  Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Server Error when Opening App in Console

2014-07-25 Thread Mike Apotheosis
The issue was my YAML file contained:-

- url: /.*
  script: about.application

Once I changed this so that the about page wasn't so greedy, it has 
worked.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: ndb, get_by_id can not get an entity with a parent key only by id?

2014-07-25 Thread Jay
I just deployed a little test app. It is under quota so I don't think 
appstats is reporting that for me.

However, the important thing to note in this context is that whether I use 
the db api or ndb, it is the same datastore operation ... which is a query 
in this case.

If you still need proof, I suggest you write your own test application. 
As Vinny suggested, you can post that and there might be some more 
discussion to come from it.

On Friday, July 25, 2014 9:26:27 AM UTC-5, saintthor wrote:

 how many entities is in your db? how many ops cost for one call?

 在 2014年7月25日星期五UTC+8上午8时03分44秒,Jay写道:

 I wrote a simple test app that used both the db and ndb api and deployed 
 it to app engine. Using appstats I confirmed that both RunQuery when 
 getting the list of articles.

 On Wednesday, July 23, 2014 8:03:40 PM UTC-5, Jay wrote:

 I refer you to line 3865 of __init__ in the ext.db package in the sdk. 
 This is on a _ReverseReferenceProperty that gets setup.
 If I have time tomorrow I will write a quick test to demonstrate.

 On Wednesday, July 23, 2014 11:11:31 AM UTC-5, saintthor wrote:

 are you sure?

 i tested in two apps. the first is using query. when i do a query, the 
 read ops increases about 300. the second is using referenceproperty as 
 above, after 5 times showing, there is no obviously increase.

 the articles in the second app is much more than the first. so i don't 
 think it run a query.

 在 2014年7月22日星期二UTC+8下午11时20分14秒,Jay写道:

 When you use that api in db, it is doing a query underneath the covers.

 On Monday, July 21, 2014 11:27:08 PM UTC-5, saintthor wrote:

 in db, i set such a property in model article:

 auth = db.ReferenceProperty( author, collection_name=AuthSet )


 and use author.AuthSet to get all articles written by the certain 
 author. there is no query. how can i do the same thing in ndb?


 在 2014年7月22日星期二UTC+8上午3时55分28秒,Jay写道:

 Responding to your first post ... that is right. The parent key is 
 part of the entity's key. When you use get_by_id, this is just 
 shorthand 
 for Key('Foo', 99).get().
 You cannot get an entity by key unless you know the key, the whole 
 key. 

 You say you don't want to query, but your use case ... give me all 
 articles for user A ... sounds like a query. 
 articles = Article.query(Article.author == user_key)...

 If you want to do something like most recent n articles then you 
 can store those keys in a 'secondary index' of sorts and use 
 ndb.get_multi()

 On Monday, July 21, 2014 8:11:20 AM UTC-5, saintthor wrote:

 to query may cost too many ops. i don't query.



 在 2014年7月21日星期一UTC+8下午8时53分29秒,Kaan Soral写道:

 Not associated with google, also not an expert on ndb

 As far as I know key groups are related with consistency, in my 
 opinion, you shouldn't put article's and author's in the same group, 
 there 
 is a 1/s write speed limit on entity groups, if you put them in the 
 same 
 entity group, you could hit this limit more easily

 You don't even have to use referenceproperty's - I would just put 
 the author key in an article StringProperty named author and query 
 for 
 it, if I were you



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Datastore Indexes... What's actually supported... My understanding

2014-07-25 Thread Doug Anderson
Having recently significantly exceeded the 200 index limit... I began 
trying to figure out what GAE actually supports in a desperate attempt to 
get back under the limit.  You'd think the documentation would make this 
clear and maybe it does for bigger brains than mine.  But for me some of 
the older articles and videos just muddy the water and make it unclear 
what's actually real today vs wishful thinking from the past.  The 2011 
Alfred Fuller article does a pretty good job of getting you on the right 
track (https://developers.google.com/appengine/articles/indexselection). 
 The Zigzag merge join that Alfred describes seems to be real and available 
today.  However, there is one limitation that was unclear to me and I 
summarize my understanding as follows:

*GAE can use any combination of indexes to satisfy a query AS LONG AS the 
index contains no outsiders.*

In other words... every field in an index MUST be in the filter expression 
or the index will NOT be used!!!

Stated yet another way... GAE does NOT use more specific indexes to satisfy 
less specific queries.

For example,

Index(Model, field1, field2, fieldSort)
Can NOT be used with:
   SELECT * from Model WHERE field1=val1 ORDER BY fieldSort
   SELECT * from Model WHERE field2=val2 ORDER BY fieldSort
Because the index contains fields that are NOT in the filter expression of 
each query

Given,

Index(Model, field1, field2, fieldSort)
Index(Model, field3, field4, fieldSort)
CAN be used with:
   SELECT * from Model WHERE field1=val1 AND field2=val2  ORDER BY fieldSort
   SELECT * from Model WHERE field3=val3 AND field4=val4  ORDER BY fieldSort
   SELECT * from Model WHERE field1=val1 AND field2=val2 AND field3=val3 
AND field4=val4 ORDER BY fieldSort
Can NOT be used with:
   SELECT * from Model WHERE field1=val1 AND field2=val2 AND field3=val3 
ORDER BY fieldSort
   (or any other combination of 3 fields)
BECAUSE the second index contains field4 (an outsider) which is NOT in the 
filter expression!
(and field3 isn't available in any other index)

Indexing each field individually as Alfred discusses works for any 
combination of fields 1-4 with fieldSort because GAE can
always find a set of indexes that contain no outsiders.  It's really as 
simple as that!

Overlap is OK but outsiders are NOT

Index(Model, field1, field2, field3, fieldSort)
Index(Model, field2, field3, field4, fieldSort)
CAN be used with:
   SELECT * from Model WHERE field1=val1 AND field2=val2 AND field3=val3 
AND field4=val4 ORDER BY fieldSort
The overlap of fields 2,3 in the indexes are OK and there are no outsiders 
in either index
However, now the following queries DON''T WORK because there are outsiders 
in the available indexes:
   SELECT * from Model WHERE field1=val1 AND field2=val2  ORDER BY 
fieldSort  (field3 is an outsider)
   SELECT * from Model WHERE field3=val3 AND field4=val4  ORDER BY 
fieldSort  (field2 is an outsider)

Anyway... I just thought I would share my insight FWIW
I still don't know if I can make the 200 index limit but at least now *I 
think* I understand what works and what doesn't. :)


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.