Wouldn't you have to use "NOT IN" to select the free spots in a regular 
SQL database?

And when you have 10 courts, 1,000 clubs, I don't see where the "10" 
records are coming from -- assuming the booking percentage is at least 
50%, then you'd have to consider 5,000 records even in the SQL case. But 
if you index the records by club and then by time, and you know which 
clubs are close enough to the user, then the number of records returned 
should be quite manageable.

Finally, there is a difference between "performance" and "scalability." 
Roughly, if the runtime of an algorithm is k*f(N), then "performance" 
attempts to reduce the k (which can be very useful), whereas 
"scalability" attempts to push f into a lower complexity class (e g from 
N-squared to N-log-N). You seem quite hung up on the "k" part, whereas 
the "pre-create all records" solution is a solution to the "f" question. 
There exists an upper limit to any single SQL server, so federated data 
is the norm in enterprise data centers. The Google model isn't that far 
away from the federated model in the degree of re-design you have to do 
compared to the "naive" regular SQL schema.

Finally, you can easily assume that "no record == free" if there is a 
separate record saying what the opening times are for each club for each 
day. That way, you can create the list of un-booked spots for each club 
for a given time period using only a small bit of logic (basically doing 
the final join yourself). That's pretty good, given that you then get 
"infinite" scalability, IMO.

Sincerely,

jw


Ian Bambury wrote:
> Hi Jon,
>
> Partly it's 'old school' thinking, I admit. But partly it's that 10 
> positive records (actual bookings) just has to be quicker to check 
> than a billion negative (no booking) records and yes, you have 
> indexes, but however great your indexing, you still have to maintain 
> or rebuild your indexes, and that too is going to be quicker on 10 
> records.
>
> I don't like things that are a waste of space :-)
>
> Ian
>
> http://examples.roughian.com
>


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to