Thanks, Nick. Yes I am already using a similar approach to paging. I
did not know about this module, which probably can replace what i have
written so will definitely look into that. Btw, the link to the
pager.py file is down so here the google cache link to the required
class:

http://74.125.155.132/search?q=cache:23LPEeO2oHIJ:https://bitbucket.org/moraes/appengine/src/tip/pager.py+PagerQuery+app+engine&cd=5&hl=en&ct=clnk&gl=us&client=firefox-a

I also grabbed the source and put it on drop.io: http://drop.io/pagerquery

Regarding the zip based filtering I was trying to do something like:
assuming I know the lat/long of the zip code of interest then this
simple query will get nearby zip codes (square region), which can be
filtered down by using a great circle algo...

SELECT * FROM ZipData WHERE latitude >= x AND latitude <= y AND
longitude >= r AND longitude <= s

As I understand the above query cannot be executed on Datastore due to
the multiple inequality operator use. If you think there is another
way to get the same result (that will work with datstore), please let
me know.

#2:
Yup, I meant just keeping the session.  I did not think of memcache
and was just thinking about how the application itself is cached. It
makes more sense just to use memcache so I can control the process.
Thanks for your suggestion.

-e

On Jun 17, 3:09 am, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:
> Hi ecognium,
>
> On Wed, Jun 17, 2009 at 9:17 AM, ecognium <ecogn...@gmail.com> wrote:
>
> > Hi All,
> >     My application requires certain types of query features that are
> > not currently possible through Datastore API and so I am thinking of
> > moving the query side of things to Anazon's SimpleDB (mainly use it to
> > return keys). For example, I would like to return entities that are
> > within a certain zip code range while supporting pagination. Since key
> > based paging takes the only inequality operator allowed, it is not
> > possible to do the traditional zip based retrieval.  Even without
> > paging there is no way to have two inequality operator.  Hence the
> > switch to SimpleDB -- let me know if there are any nice workarounds
> > for zip-based data retrieval.
>
> You may want to check this 
> out:http://appengine-cookbook.appspot.com/recipe/efficient-paging-for-any...
>
>
>
> > I have two questions for App Engine members:
>
> > 1. Have you noticed any major latency issues in accessing SimpleDB
> > from App Engine (thinking of using Boto module)? If so, any tips on
> > how to reduce it?
>
> I haven't personally used SimpleDB, but the same caveats apply as with any
> other service accessed over HTTP - latency is dependent on the service and
> its proximity.
>
>
>
> > 2. When I tested SimpleDB from my dev machine, I noticed SimpleDB
> > takes up to 5 seconds to return results -- most of the time is
> > actually spent in authorizing the request. So I would like to initiate
> > the connection once in the app and reuse the object for all subsequent
> > queries. Where should I do this initialization? I am not familiar with
> > how App Engine caches the application. Should I create a
> > amazon_login.py, include the logic for auth (two lines of code) and
> > import the file in my code? or do I need to put it in a class and
> > instantiate the class in the same file?
>
> When you say "initiate the connection once", are you referring to an actual
> TCP connection, or to a 'session'? I presume the latter, since SimpleDB is
> HTTP based.
>
> urlfetch doesn't let you control the lifetime of the underlying TCP
> connection for HTTP requests. If you're obtaining an authentication token,
> though, you can certainly do that on the first request to a given runtime,
> and then cache the result in a global or class-level variable, or cache it
> in memcache and reuse it across multiple instances.
>
> -Nick Johnson
--~--~---------~--~----~------------~-------~--~----~
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