Re: [appengine-java] Re: Version not ready error (but it's ready)

2010-06-09 Thread Tristan Slominski
Thank you very much, after upgrading to 1.3.4 it works :)

On Tue, Jun 8, 2010 at 18:13, Don Schwarz schwa...@google.com wrote:

 What version of the SDK are you using?  I believe that this deadline was
 increased significantly in 1.3.4.


 On Tue, Jun 8, 2010 at 10:39 PM, Tristan tristan.slomin...@gmail.comwrote:

 Well??? This problem happens EVERY time I deploy these days. As a
 result Google App Engine has become USELESS as a hosting solution.
 Any plans to fix this? Anything I can do on my side so that my uploads
 work?

 On Jun 7, 4:59 pm, Tristan tristan.slomin...@gmail.com wrote:
  I keep on getting this during deployment:
 
  Deploying newversion.
  Will check again in 1 seconds
  Will check again in 2 seconds
  Will check again in 4 seconds
  Will check again in 8 seconds
  Will check again in 16 seconds
  Will check again in 32 seconds
  Will check again in 64 seconds
  Will check again in 128 seconds
  Rolling back the update.
  java.lang.RuntimeException:Versionnot ready.
 
  This happens almost every time I deploy. The thing is, the application
  code deploys just fine, but this error prevents any updates to indexes
  or queues.
 
  In summary, the newversiongets deployed to the app engine just fine.
  I can set it as defaultversionand it works. What breaks is that any
  queues or indexes are not updated because they never get uploaded due
  to the above error.
 
  Please help.

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: AppEngine gets very slow when not used for some time

2010-05-24 Thread Tristan Slominski
This sounds a lot like the sharded counter scenario. I think they came up
with a committing to datastore strategy that worked well.

On another hand, you can always queue a task and let the task queue persist
the preferences when it gets around to it.

On Mon, May 24, 2010 at 11:16, Rahul rahul.jun...@gmail.com wrote:

 Ok. Let me explain the complete scenario.

 Suppose I have lot of preference on my page which are stored in the
 database. Now i have multiple options,
 1. Load all the preference in Hashmap in a servlet and mark that
 servlet as Load-on-startup to 0 and then use the hashmap cache when a
 new user visits the page. User can also change the values of
 preference and yes if one use change the preference it will be
 globally changed for all the new users coming to that page.
 2. Create a memcache and load the cache in a servlet with load-on-
 startup as 0. When any new user comes read the memcache and if the
 value is present use that else go to the database (which will almost
 never happen as i will update the memcache when some user change the
 preferences).

 I also have a requirement if ever a user changes the preferences i
 need to store the new preference in the database so where should we
 persist this, I mean on some specific time or when the user changes
 immediately.

 Any pointer.

 Thanks,
 Rahul

 On May 24, 9:47 am, Rahul rahul.jun...@gmail.com wrote:
  Chau,
 
  I have already tried various solutions out of those mentioned above,
  including b) request Google to load your app before start dispatch
  request to that instance   but it is still slow, My exact question is
  when to put the data in cache.
 
  Thanks,
  Rahul
 
  On May 24, 4:49 am, Chau Huynh cmhu...@gmail.com wrote:
 
 
 
 
 
   Hi Rahul,
 
   About loading request/performance, there're lots of discussions that
 you can
   find in the groups, please just try google it.
 
   Here are some notes based on reading those.
   Latency causes by
   1- time to start new JVM
   2- time to load your application
 
   To reduce load time by 1) others star request to
   a) pay to reserve JVM
   b) request Google to load your app before start dispatch request to
 that
   instance
   c) accept the situation
 
   For 2) we try to
   a- try to use/replace frameworks with light-weight ones: datastore
 access
   framework, MVC framework,...
   b- try to limit calculation in your index page to alleviate the impact
 of
   loading request
   c- design your object model based on your need, so that you do
 calculation
   at insert time, not at query time. For example, in my app, if I want to
   report on year and quarter, then I have 5 summary record for those,
   instead of querying and computing those
   d- caching result. For example, If I know 1 one 5 piece of data above
 would
   be read frequently, then I will read those 5 all, and put into memcache
 for
   later use
   ...
 
   So it's application-specific, I don't know if each of above can help
 you.
   But only you who can know if which one of your code can be cached and
 how...
 
   HTH
 
   On Sun, May 23, 2010 at 11:37 AM, Rahul rahul.jun...@gmail.com
 wrote:
Chau,
 
Thanks for pointing to the link. I did go through the link and i
think, what i thought was right.
Also i was going through the following point in the section you
provided : How can I speed up loading requests?  and the second
point mentioned is Share expensive initialization between JVMs. For
example, put data which is expensive to read or compute into
 memcache,
where it can be quickly read by other JVMs during startup. so in
 this
scenario where do you load this memcache so that it can be shared
between the jvm instances.
 
Any pointers or clues highly appreciated.
 
Thanks,
Rahul
 
On May 22, 10:51 pm, Chau Huynh cmhu...@gmail.com wrote:
 It seems like loading request...
   
 http://code.google.com/appengine/kb/java.html#What_Is_A_Loading_Request
 
 On Sun, May 23, 2010 at 4:55 AM, Rahul rahul.jun...@gmail.com
 wrote:
  I have an application running on appengine and no doubt it works
  great. but when the application is not used for some time. it
 goes
  very slow.
  Suppose i don;t use the application for around 5 hours or so,
 then
  next time when i try to use it, the response is very slow. Is
 there
  any thing specific which i am missing in adding application to
  appengine.
 
  Any clues are pointers are highly appreciated.
 
  Thanks,
  Rahul
 
  --
  You received this message because you are subscribed to the
 Google
Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B
 unsubscr...@googlegroups.com

Re: [appengine-java] Re: indexes

2010-05-04 Thread Tristan Slominski
Ah, I understand. Yeah, they don't show you the automatic ones.

On Tue, May 4, 2010 at 03:16, Philip Tucker ptuc...@gmail.com wrote:

 Thanks. By table I mean annotated Java class. One reason I was
 confused about the indexes is I don't see many of the ones I would
 expect when I navigate to https://appengine.google.com/datastore/indexes,
 but I guess they must exist or my queries would be failing.

 On Apr 30, 2:16 pm, Tristan tristan.slomin...@gmail.com wrote:
  uhm... read the next section?
 
  http://code.google.com/appengine/docs/java/datastore/queriesandindexe...
 
  as far as indexes getting applied to existing tables... (not sure by
  what you mean by table), but yes, that's why when you upload new
  index it is building, it's being applied to existing stuff.
 
  On Apr 30, 12:54 am, Philip Tucker ptuc...@gmail.com wrote:
 
 
 
 
 
   According to this, The App Engine datastore maintains an index for
   every query an application intends to make.
 
  http://code.google.com/appengine/docs/java/datastore/queriesandindexe.
 ..
 
   Does GAE just scan the app Java code for Query.setFilter, or do we
   need to do annotate queries for these indexes to be generated.
 
   Also, it appears new indexes do not get applied to existing tables
   when we deploy application code with new queries or @INDEX annotations
   - is this correct? Is there a way to do that, or are we required to
   create a new table and copy the data over?
 
   --
   You received this message because you are subscribed to the Google
 Groups Google App Engine for Java group.
   To post to this group, send email to
 google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
   For more options, visit this group athttp://
 groups.google.com/group/google-appengine-java?hl=en.
 
  --
  You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
  To post to this group, send email to
 google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group athttp://
 groups.google.com/group/google-appengine-java?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Inequality Filters Are Allowed On One Property Only

2010-05-04 Thread Tristan Slominski
Yes, but then you just do a test on the entity you got from the query (one
test on one entity, fast)

so add a last step.. using previous logic you end up with x2=71 y2=75
final step will beis (z of 76)  (y2 of 75)   if no... no results..   if
yes... have 1 result

that should solve that part

On Tue, May 4, 2010 at 02:04, romesh soni soni.rom...@gmail.com wrote:

 Hi Tristan,

 Really appreciate the logic you suggested.  But consider this case:

 There are only two intervals in db: x1 = 4   y1 = 70   and  x2 = 71   y2 =
 75.

 I want to search by 76. The 76 doesn't fall in any category but still the
 query will return the second interval, which is not correct.
 Instead the query should say that there is no matching interval. Am I
 correct?

 Regards
 Romesh


 On Tue, May 4, 2010 at 11:09 AM, Tristan Slominski 
 tristan.slomin...@gmail.com wrote:

 in that case the solution to your dilemma is as follows

 query.addFilter(x, FilterOptions.LESS_THAN, z);
 query.addSort(x, SortOrder.DESC);

 then execute the query with a limit of 1
 that is the answer you seek

 in other words...

 assume you have two intervalsx1 = 4   y1 = 70   and  x2 = 71   y2 =
 75.
 you want to find interval that matches your condition ofx  74  y

 add filter for x less than 74 will give you two results where x1=4 in
 first result and x2=71 in second result
 now sort these results descending so that x2 is the first result   x2=71
 x1=4
 set limit of 1 gives your query a result of x2

 you don't need property y

 does that work for you?

 On Mon, May 3, 2010 at 22:45, romesh soni soni.rom...@gmail.com wrote:

 Hi Tristan,

 You got a good catch. But the code which populates the data will never
 let this happen. If there is a pair x = 4 and y = 10, then there will be no
 such other pair which consist values between 4 and 10. there will be one and
 only one set for values 4,5,6,7,8,9,10 and that will be (4,10). I hope my
 explanation is helpful. So it is guaranteed of having one solution per
 query.

 On Mon, May 3, 2010 at 7:31 PM, Tristan Slominski 
 tristan.slomin...@gmail.com wrote:

 Hey, so I've been thinking about the problem description... you
 mentioned that there will ever only be one solution for the query, but that
 doesn't seem like a valid constraint. For example, let x = 4 and y = 10, 
 let
 x2 = 5 and y2 = 11.  The value of z = 6 will result in two solutions.

 The reason I am asking, is that the contraint of only one solution
 existing suggest a different mapping of solutions than the one you 
 suggested
 (not sure what that different approach would be yet, but it could be
 something along the lines of enumerating the intervals).

 Can you guarantee the constraint of only one solution per query?

 On May 3, 2010 3:01 AM, romesh soni soni.rom...@gmail.com wrote:

 Hi Thomas,

 the possible value of x and y can be 2020 and 203204206207.
 do you see that it is possible to make such thing in 5000 element
 limitation. Are you talking of ArrayList?

 Your solution is good for small list, but I am afraid that it will not
 suit my requirement..




 On Mon, May 3, 2010 at 1:00 PM, Thomas mylee...@gmail.com wrote:
 
  Hi romesh:
 
 Datastor...

  --
 You received this message because you are subscribed to the Google
 Groups Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en

Re: [appengine-java] Re: Inequality Filters Are Allowed On One Property Only

2010-05-04 Thread Tristan Slominski
Sure, good luck.

On May 4, 2010 9:03 AM, romesh soni soni.rom...@gmail.com wrote:

Hey Tristan,

Seems you have got it solved. Thanks. I think it should work for me without
any issues. I will let you know once I implement it.
You have a good logic man. Can I add you on Gmail?

Thanks and Regards
Romesh



On Tue, May 4, 2010 at 7:08 PM, Tristan Slominski 
tristan.slomin...@gmail.com wrote:

 Yes, bu...

-- 
You received this message because you are subscribed to the Google Groups
Google App Engine for...

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Inequality Filters Are Allowed On One Property Only

2010-05-03 Thread Tristan Slominski
Hey, so I've been thinking about the problem description... you mentioned
that there will ever only be one solution for the query, but that doesn't
seem like a valid constraint. For example, let x = 4 and y = 10, let x2 = 5
and y2 = 11.  The value of z = 6 will result in two solutions.

The reason I am asking, is that the contraint of only one solution existing
suggest a different mapping of solutions than the one you suggested (not
sure what that different approach would be yet, but it could be something
along the lines of enumerating the intervals).

Can you guarantee the constraint of only one solution per query?

On May 3, 2010 3:01 AM, romesh soni soni.rom...@gmail.com wrote:

Hi Thomas,

the possible value of x and y can be 2020 and 203204206207.
do you see that it is possible to make such thing in 5000 element
limitation. Are you talking of ArrayList?

Your solution is good for small list, but I am afraid that it will not suit
my requirement..




On Mon, May 3, 2010 at 1:00 PM, Thomas mylee...@gmail.com wrote:

 Hi romesh:

Datastor...

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Inequality Filters Are Allowed On One Property Only

2010-05-03 Thread Tristan Slominski
in that case the solution to your dilemma is as follows

query.addFilter(x, FilterOptions.LESS_THAN, z);
query.addSort(x, SortOrder.DESC);

then execute the query with a limit of 1
that is the answer you seek

in other words...

assume you have two intervalsx1 = 4   y1 = 70   and  x2 = 71   y2 = 75.
you want to find interval that matches your condition ofx  74  y

add filter for x less than 74 will give you two results where x1=4 in first
result and x2=71 in second result
now sort these results descending so that x2 is the first result   x2=71
x1=4
set limit of 1 gives your query a result of x2

you don't need property y

does that work for you?

On Mon, May 3, 2010 at 22:45, romesh soni soni.rom...@gmail.com wrote:

 Hi Tristan,

 You got a good catch. But the code which populates the data will never let
 this happen. If there is a pair x = 4 and y = 10, then there will be no such
 other pair which consist values between 4 and 10. there will be one and only
 one set for values 4,5,6,7,8,9,10 and that will be (4,10). I hope my
 explanation is helpful. So it is guaranteed of having one solution per
 query.

 On Mon, May 3, 2010 at 7:31 PM, Tristan Slominski 
 tristan.slomin...@gmail.com wrote:

 Hey, so I've been thinking about the problem description... you mentioned
 that there will ever only be one solution for the query, but that doesn't
 seem like a valid constraint. For example, let x = 4 and y = 10, let x2 = 5
 and y2 = 11.  The value of z = 6 will result in two solutions.

 The reason I am asking, is that the contraint of only one solution
 existing suggest a different mapping of solutions than the one you suggested
 (not sure what that different approach would be yet, but it could be
 something along the lines of enumerating the intervals).

 Can you guarantee the constraint of only one solution per query?

 On May 3, 2010 3:01 AM, romesh soni soni.rom...@gmail.com wrote:

 Hi Thomas,

 the possible value of x and y can be 2020 and 203204206207.
 do you see that it is possible to make such thing in 5000 element
 limitation. Are you talking of ArrayList?

 Your solution is good for small list, but I am afraid that it will not
 suit my requirement..




 On Mon, May 3, 2010 at 1:00 PM, Thomas mylee...@gmail.com wrote:
 
  Hi romesh:
 
 Datastor...

  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: WARNING: This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus t

2010-04-22 Thread Tristan Slominski
Don't worry about it, it really should be INFO. Its telling you that another
jvm started to serve the requests. Its a warning because the assumption is
that it is taking you too long to bservice requests and if the trend
continues you'l keep starting new jvms eating up your quota. If you think
you're ok and can't compute a response any faster then there's nothing that
needs to be done. Hence it should be INFO

On Apr 22, 2010 10:09 AM, Abhimanyu Saxena abhimanyusax...@gmail.com
wrote:

so what does it mean? I am repeatedly getting this warning with my
app... is there anything that I can do for it ?


On Apr 22, 7:24 am, Tristan tristan.slomin...@gmail.com wrote:
 Is it possible to make it an INFO and not a WARNING? Should I start an
 issue? As a programmer, I really don't have any direct control over
 this. All the WARNINGS are just masking other important issues that
 should be warnings.

 On Apr 21, 1:33 pm, Ikai L (Google) ika...@google.com wrote:



  Yep, we're rolling this out slowly with the 1.3.3 release to let
developers
  know that some requests are slow because they are startup requests.

  On Wed, Apr 21, 2010 at 6:09 AM, Tristan tristan.slomin...@gmail.com
wrote:

   Hey,

   I started seeing when a task queue starts now:

   WARNING: 200 OK
   This request caused a new process to be started for your application,
   and thus caused your application code to be loaded for the first time.
   This request may thus take longer and use more CPU than a typical
   request for your application.

   instead of this

   WARNING: 500
   Request was aborted after waiting too long to attempt to service your
   request. Most likely, this indicates that you have reached your
   simultaneous dynamic request limit. This is almost always due to
   excessively high latency in your app. Please see
  http://code.google.com/appengine/docs/quotas.htmlformore details.

   I like it. Is this the expected behavior from now on?

   Tristan

   --
   You received this message because you are subscribed to the Google
Groups
   Google App Engine for Java group.
   To post to this group, send email to
   google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B
unsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.

  --
  Ikai Lan
  Developer Relations, Google App Engine
  Twitter:http://twitter.com/ikai
  Delicious:http://delicious.com/ikailan

  
  Google App Engine links:
  Blog:http://googleappengine.blogspot.com
  Twitter:http://twitter.com/app_engine
  Reddit:http://www.reddit.com/r/appengine

  --
  You received this message because you are subscribed to the Google
Groups Google App Engine for Java group.
  To post to this group, send email to
google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
.
  For more options, visit this group athttp://
groups.google.com/group/google-appengine-java?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
Google App Engine for Java group.
 To post to this group, send email to
google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
.
 For more options, visit this group athttp://
groups.google.com/group/google-appengine-java?hl=en.

--
You received this message because you are subscribed to the Google Groups
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Why do custom indexes require single-property indexes?

2010-03-18 Thread Tristan Slominski
Thanks :)

On Thu, Mar 18, 2010 at 11:55 AM, Jeff Schnitzer j...@infohazard.orgwrote:

 Here's a link:

 http://groups.google.com/group/google-appengine/browse_thread/thread/2f6aa695a80fd5de

 Jeff

 On Thu, Mar 18, 2010 at 9:22 AM, Tristan tristan.slomin...@gmail.com
 wrote:
  Jeff,
 
  Sounds to me like you're correct in the not only don't set single-
  property indexes, but also don't include the property in any custom
  indexes interpretation of setUnindexedProperty. Can you post the link
  to the continuation post? I'm curious what Googlers have to say about
  it.
 
  Tristan
 
 
 
  On Mar 18, 11:13 am, Jeff Schnitzer j...@infohazard.org wrote:
  This doesn't make sense to me.
 
  Every scrap of documentation I've found says that GAE queries only
  follow a single index (the one exception being zigzag merges, which
  don't apply here).  This means that to answer my query.filter(foo,
  fooValue1).sort(-bar), there must be an index that contains the
  foo and bar data sorted appropriately, no?  Ie:
 
  /Thing/foo:fooValue1/bar:bar9/[thekeyvalue]
  /Thing/foo:fooValue1/bar:bar8/[thekeyvalue]
  /Thing/foo:fooValue1/bar:bar7/[thekeyvalue]
  /Thing/foo:fooValue2/bar:bar8/[thekeyvalue]
  /Thing/foo:fooValue2/bar:bar7/[thekeyvalue]
 
  To satisfy this query, GAE should start following this custom index
  and that's pretty much it.  There's no reason for it to touch the
  single-property indexes (foo ASC, foo DESC, bar ASC, and bar DESC).
 
  ...and in my test, if I remove the custom index from
  datastore-indexes.xml, it doesn't work.  But also if I use
  setUnindexedProperty, it doesn't work.
 
  It's like setUnindexedProperty is being interpreted as not only don't
  set single-property indexes, but also don't include the property in
  any custom indexes.  This is counterintuitive - if I wanted the index
  not to be built, I can just remove the index.
 
  I realize now that perhaps I posted this to the wrong mailing list.
  The guys who created the I/O videos about the datastore seem to be
  python fans, so I'll retry my original post on the google-appengine
  list.
 
  Jeff
 
 
 
  On Thu, Mar 18, 2010 at 8:00 AM, Tristan tristan.slomin...@gmail.com
 wrote:
   Not official but been doing this for a while.
 
   Your custom index is most likely build from the query. So, when you
   do
 
  Query query = new Query(Thing);
  query.addFilter(foo, FilterOperator.EQUAL, fooValue);
  query.addSort(bar, SortDirection.DESCENDING);
 
   That is what builds your custom index.
 
   However, when you setUnindexedProperty here
 
  Entity ent = new Entity(Thing);
  ent.setUnindexedProperty(foo, fooValue);
  ent.setUnindexedProperty(bar, 123L);
 
   You are not generating any index entries.
 
   So the issue isn't that adding custom indexes after-the-fact [is]
   really, really painful but that you are not generating any indexes
   for the datastore to run the queries against when you use
   setUnindexedProperty(). In other words, when you execute a query, it
   checks the index to give you results. But you marked your data as
   don't index me, so there is nothing for query to work with, as far
   as it is concerned, there's nothing in the datastore.
 
   Cheers!
 
   On Mar 16, 4:07 pm, Jeff Schnitzer j...@infohazard.org wrote:
   On Mon, Mar 15, 2010 at 11:04 PM, John Patterson 
 jdpatter...@gmail.com wrote:
 
On 16 Mar 2010, at 12:25, Jeff Schnitzer wrote:
 
I'm puzzled by the behavior of custom indexes.  I have a simple
 test
case below, a simple equality filter on one property combined with
 a
descending sort on another property.  If I set the properties with
setUnindexedProperty(), the query fails to find the result.  If I
 set
the properties with setProperty(), it does.
 
I also wondered why - I assume that the custom index build reads
 the single
property indexes directly which must be more efficient than reading
 the
Entities table.
 
   I guess that is possible, but seems like a poor design decision.  It
   makes adding custom indexes after-the-fact really, really painful.
 
   Can someone official chime in on this?  Is it intended behavior, or
   should we file an issue against it?  The documentation doesn't say
   much on the subject, and all the conceptual explanation of queries
   suggests that these extra single-property indexes will be unused.
 
   Jeff
 
   --
   You received this message because you are subscribed to the Google
 Groups Google App Engine for Java group.
   To post to this group, send email to
 google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
   For more options, visit this group athttp://
 groups.google.com/group/google-appengine-java?hl=en.
 
  --
  You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
  To