1

So I am trying to implement a global highscore for my game in google apps engine java. The information I want to retrieve is twofold:

  1. Which position did the user place?

  2. How many percent of all records did he beat?

The second question is solved if I solve the first one, and find a way to count the total number of rows in the database. But I know how to do neither. An ineffective solution is easy to implement, but I would prefer something that could handle a big table without slowing down.

Cheers,

pgsandstrom
  • 14,361
  • 13
  • 70
  • 104

2 Answers2

2

See this question:

How to implement internet high scores in Google App Engine

In particular you could try porting this library (or the parts of it you need) to Java:

http://code.google.com/p/google-app-engine-ranklist/

Community
  • 1
  • 1
Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
0

The following two answers address counting rows in a database in App Engine:

  1. Google AppEngine: how to count a database's entries beyond 1000?
  2. how does one get a count of rows in a datastore model in google appengine?
Community
  • 1
  • 1
Ron Romero
  • 9,211
  • 8
  • 43
  • 64
  • 1
    Counting all the highscores better than the one submitted every time you want to know its rank is a recipe for extreme slowness. – Nick Johnson Sep 03 '10 at 08:42