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

2010-04-30 Thread Tristan
do two queries? combine results only if they exist in both. On Apr 30, 8:28 am, Romesh wrote: > I have been trying to find a workaround for this limitation and spent > 2 days and read almost all blogs, discussion > groups., but can not find a solution to it. Has > any one able

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

2010-05-01 Thread romesh soni
Hi Tristan, The solution you provided is the best one among of those which I have found so far. But this is not what I was looking for, my database is quite large and its will grow continuously to millions of records in time. But there will be only 1 matching record for my filter (x<=y and y>=z) If

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

2010-05-01 Thread Tristan
Hey, So, there's no more 1000 query limitation, that went away (unless it was put back in). I see what you're saying though. Need to know more about what the problem is. I assume x and z are the two properties? It seems that x and z are correlated (since you guarantee that there is only one solut

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

2010-05-01 Thread Richard
Try to combine x and y into a granular z, which can be checked against. E.g. if for a geographic query you'd combine lat & long to get a hash with a reasonable granularity (whatever suits your application). Pre-calculate those and save them to the store. You lose out the fine-grained inequality t

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

2010-05-01 Thread Tristan
did you make an error or are you describing this condition? 1000 <= field1 <= field2 <= 1000 On May 1, 10:26 am, romesh soni wrote: > OK, let me explain the query which I need to run (I am putting the sql > server syntax for it, thats what I was working so far): > select *  from mytable where fi

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

2010-05-02 Thread Thomas
I can't imagine what your data is. Is it possible to pre-solve the solution list z for every (x, y) pair and store them like (x, y, list of z). If it is the case, you can use a simple z= filter to get your single result. Thomas On 5月2日, 下午4時57分, romesh soni wrote: > Tristan, > > sorry for the mi

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

2010-05-03 Thread Thomas
Hi romesh: Datastore allows multi-value property. So you can have each (x,y, list of possible z) in only one row and the filter is as simple as where z=. The only limitation is that list-of-z can not exceed 5000 elements. Thomas On 5月3日, 下午2時02分, romesh soni wrote: > Thomas, > > it is possi

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

2010-05-01 Thread romesh soni
OK, let me explain the query which I need to run (I am putting the sql server syntax for it, thats what I was working so far): select * from mytable where field1>=1000 and field2<=1000; Thats what I need to run on on datastore. Field1 and field 2 are have a relation. More specifically, Field1 <

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

2010-05-02 Thread romesh soni
Tristan, sorry for the mistake. I wrote the wrong thing ( I realized this at night when I went to bed for sleep) It is field1<=1000<=field2. A given value will always be between the lower and upper bound (field1 and field2). Thanks Romesh On Sun, May 2, 2010 at 11:20 AM, Tristan wrote: > did y

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

2010-05-02 Thread romesh soni
Thomas, it is possible to pre-determine the solution list for given lower and upper bounds x and y. But there can be enormous rows for a given (x,y) pair. And there will be enormous rows containing (x,y) pairs. So I can not keep a predetermined list. Regards Romesh On Mon, May 3, 2010 at 5:52 AM

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

2010-05-03 Thread romesh soni
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,

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

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

2010-05-03 Thread romesh soni
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)

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

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

2010-05-04 Thread romesh soni
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. In

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

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

2010-05-04 Thread romesh soni
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.c

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" 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, Ma