There are a couple of suggestions that I can see:

1. The datastore is not intended to be the be-all, end-all data storage 
solution. As you can see, it has its' strengths and weaknesses. In your 
case, I recommend using Cloud SQL.

2. Consider other solutions. Google Apps Script's ScriptDB ( 
https://developers.google.com/apps-script/scriptdb ) can do inequalities, 
and so can Google Spreadsheets API ( 
https://developers.google.com/google-apps/spreadsheets/#sending_a_structured_query_for_rows
 
).

2. If you absolutely insist on using the datastore, let me ask a question: 
are the time ranges that you're using highly standardized? For instance 
instead of expressing times can you express availability as 
morning/middle-of-day/afternoon/evening? So instead of doing queries that 
are number based you can do boolean equality searches (example: search all 
equipment entities that have the property tuesday_morning_available and 
wednesday_afternoon_available set to true).

3. Use TextSearch as Julie and Moises have already suggested.

4. As Julie suggested, query using one inequality, then filter on the 
remaining equality within your code.

5. If you have a small dataset, you can implement a small DB engine 
entirely in memory within a backend. It's not as reliable as using the 
datastore, but it can be faster if you implement it correctly.

-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

My Go side project: http://invalidmail.com/


On Tuesday, April 23, 2013 11:31:08 AM UTC-5, Mohsin Hijazee wrote:
>
> I have a very simple problem to which I cannot find an appropriate 
> solution. I have a simple model that records multiple timespans for an 
> equipment which indicates what time ranges are in which that equipment can 
> be used. 
>
> For instance:
>
>
>    - Monday 12:00 AM to 3:00 AM
>    - Monday 7:00 AM to 11:00 AM
>    - Tuesday 4:30 PM to 5:00 PM
>
> Now for a single equipment, I would want to retain this information. My 
> use case is that I would be selecting a day and a start and end range (say 
> 4:00 PM to 9:00 PM) to check what equipment is available. But 
> unfortunately, inequality operators on two different properties within 
> single property aren't allowed so that's not possible:
>
> SELECT * FROM Equipment WHERE from_time >= 1600 AND to_time <= 2100
>
> How you would suggest to model such a thing on Google App Engine? 
>
>
>
>
>

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


Reply via email to