Perf stats v1

Hi Gabriel,

I finished implementing and debugging the get k largest things from the database. I tested it, so as far as I know it should be working.

Note that we have to still need to specify in the settings file somehow what the size of k should.