Simplify SpatialIndexCursor
Simplify SpatialIndexCursor

Summary:
Since we have enough memory to hold all primary keys loaded from spatial index, it is better if we first load all of them (store them in unordered_set for deduplication) and then query on primary key column family one by one.

We need to dedup all IDs, so we'll end up storing all of them in memory even with the current approach.

Test Plan: ./spatial_db_test is happy

Reviewers: yinwang

Reviewed By: yinwang

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D20949

jalexanderqed/rocksdb,ylong/rocksdb,rDSN-Projects/rocksdb.replicated,Vaisman/rocksdb,zhangpng/rocksdb,wat-ze-hex/rocksdb,hobinyoon/rocksdb,siddhartharay007/rocksdb,Andymic/rocksdb,JoeWoo/rocksdb,SunguckLee/RocksDB,alihalabyah/rocksdb,amyvmiwei/rocksdb,wat-ze-hex/rocksdb,ylong/rocksdb,flabby/rocksdb,rDSN-Projects/rocksdb.replicated,fengshao0907/rocksdb,lgscofield/rocksdb,ryneli/rocksdb,vashstorm/rocksdb,vmx/rocksdb,facebook/rocksdb,tsheasha/rocksdb,JohnPJenkins/rocksdb,ylong/rocksdb,IMCG/RcoksDB,makelivedotnet/rocksdb,kaschaeffer/rocksdb,wat-ze-hex/rocksdb,wlqGit/rocksdb,JackLian/rocksdb,msb-at-yahoo/rocksdb,ryneli/rocksdb,flabby/rocksdb,fengshao0907/rocksdb,fengshao0907/rocksdb,amyvmiwei/rocksdb,wlqGit/rocksdb,tsheasha/rocksdb,geraldoandradee/rocksdb,tschottdorf/rocksdb,JoeWoo/rocksdb,wskplho/rocksdb,OverlordQ/rocksdb,alihalabyah/rocksdb,ryneli/rocksdb,wskplho/rocksdb,lgscofield/rocksdb,tschottdorf/rocksdb,Andymic/rocksdb,JoeWoo/rocksdb,fengshao0907/rocksdb,fengshao0907/rocksdb,NickCis/rocksdb,rDSN-Projects/rocksdb.replicated,temicai/rocksdb,lgscofield/rocksdb,msb-at-yahoo/rocksdb,wat-ze-hex/rocksdb,RyanTech/rocksdb,lgscofield/rocksdb,wlqGit/rocksdb,norton/rocksdb,NickCis/rocksdb,temicai/rocksdb,siddhartharay007/rocksdb,hobinyoon/rocksdb,RyanTech/rocksdb,luckywhu/rocksdb,anagav/rocksdb,hobinyoon/rocksdb,Applied-Duality/rocksdb,geraldoandradee/rocksdb,wenduo/rocksdb,fengshao0907/rocksdb,sorphi/rocksdb,vashstorm/rocksdb,biddyweb/rocksdb,anagav/rocksdb,caijieming-baidu/rocksdb,amyvmiwei/rocksdb,vmx/rocksdb,Vaisman/rocksdb,SunguckLee/RocksDB,IMCG/RcoksDB,bbiao/rocksdb,SunguckLee/RocksDB,luckywhu/rocksdb,geraldoandradee/rocksdb,NickCis/rocksdb,caijieming-baidu/rocksdb,Andymic/rocksdb,Applied-Duality/rocksdb,virtdb/rocksdb,jalexanderqed/rocksdb,JohnPJenkins/rocksdb,skunkwerks/rocksdb,geraldoandradee/rocksdb,wlqGit/rocksdb,makelivedotnet/rocksdb,facebook/rocksdb,temicai/rocksdb,tizzybec/rocksdb,tizzybec/rocksdb,mbarbon/rocksdb,tschottdorf/rocksdb,SunguckLee/RocksDB,JoeWoo/rocksdb,geraldoandradee/rocksdb,vmx/rocksdb,JackLian/rocksdb,msb-at-yahoo/rocksdb,sorphi/rocksdb,bbiao/rocksdb,facebook/rocksdb,skunkwerks/rocksdb,alihalabyah/rocksdb,amyvmiwei/rocksdb,rDSN-Projects/rocksdb.replicated,OverlordQ/rocksdb,bbiao/rocksdb,alihalabyah/rocksdb,hobinyoon/rocksdb,kaschaeffer/rocksdb,OverlordQ/rocksdb,tizzybec/rocksdb,anagav/rocksdb,norton/rocksdb,makelivedotnet/rocksdb,JoeWoo/rocksdb,wskplho/rocksdb,caijieming-baidu/rocksdb,alihalabyah/rocksdb,facebook/rocksdb,flabby/rocksdb,skunkwerks/rocksdb,wskplho/rocksdb,virtdb/rocksdb,zhangpng/rocksdb,zhangpng/rocksdb,Applied-Duality/rocksdb,msb-at-yahoo/rocksdb,Vaisman/rocksdb,JoeWoo/rocksdb,dkorolev/rocksdb,ryneli/rocksdb,kaschaeffer/rocksdb,SunguckLee/RocksDB,norton/rocksdb,vmx/rocksdb,flabby/rocksdb,amyvmiwei/rocksdb,OverlordQ/rocksdb,biddyweb/rocksdb,facebook/rocksdb,ryneli/rocksdb,RyanTech/rocksdb,siddhartharay007/rocksdb,amyvmiwei/rocksdb,flabby/rocksdb,bbiao/rocksdb,JohnPJenkins/rocksdb,biddyweb/rocksdb,zhangpng/rocksdb,makelivedotnet/rocksdb,Andymic/rocksdb,siddhartharay007/rocksdb,hobinyoon/rocksdb,dkorolev/rocksdb,dkorolev/rocksdb,sorphi/rocksdb,vmx/rocksdb,JoeWoo/rocksdb,jalexanderqed/rocksdb,OverlordQ/rocksdb,luckywhu/rocksdb,hobinyoon/rocksdb,wlqGit/rocksdb,sorphi/rocksdb,temicai/rocksdb,bbiao/rocksdb,mbarbon/rocksdb,wenduo/rocksdb,ylong/rocksdb,temicai/rocksdb,siddhartharay007/rocksdb,hobinyoon/rocksdb,Vaisman/rocksdb,JackLian/rocksdb,wat-ze-hex/rocksdb,caijieming-baidu/rocksdb,norton/rocksdb,biddyweb/rocksdb,tizzybec/rocksdb,zhangpng/rocksdb,luckywhu/rocksdb,norton/rocksdb,anagav/rocksdb,RyanTech/rocksdb,alihalabyah/rocksdb,caijieming-baidu/rocksdb,mbarbon/rocksdb,wenduo/rocksdb,Applied-Duality/rocksdb,wlqGit/rocksdb,Andymic/rocksdb,NickCis/rocksdb,caijieming-baidu/rocksdb,tschottdorf/rocksdb,vmx/rocksdb,JackLian/rocksdb,skunkwerks/rocksdb,skunkwerks/rocksdb,facebook/rocksdb,lgscofield/rocksdb,SunguckLee/RocksDB,vmx/rocksdb,IMCG/RcoksDB,wat-ze-hex/rocksdb,tsheasha/rocksdb,siddhartharay007/rocksdb,wenduo/rocksdb,IMCG/RcoksDB,alihalabyah/rocksdb,virtdb/rocksdb,norton/rocksdb,tsheasha/rocksdb,JackLian/rocksdb,temicai/rocksdb,SunguckLee/RocksDB,mbarbon/rocksdb,wskplho/rocksdb,OverlordQ/rocksdb,wenduo/rocksdb,luckywhu/rocksdb,rDSN-Projects/rocksdb.replicated,sorphi/rocksdb,flabby/rocksdb,ryneli/rocksdb,lgscofield/rocksdb,wenduo/rocksdb,geraldoandradee/rocksdb,zhangpng/rocksdb,Vaisman/rocksdb,IMCG/RcoksDB,dkorolev/rocksdb,anagav/rocksdb,rDSN-Projects/rocksdb.replicated,anagav/rocksdb,JohnPJenkins/rocksdb,tschottdorf/rocksdb,biddyweb/rocksdb,biddyweb/rocksdb,siddhartharay007/rocksdb,skunkwerks/rocksdb,tschottdorf/rocksdb,RyanTech/rocksdb,hobinyoon/rocksdb,anagav/rocksdb,jalexanderqed/rocksdb,amyvmiwei/rocksdb,mbarbon/rocksdb,OverlordQ/rocksdb,jalexanderqed/rocksdb,biddyweb/rocksdb,Andymic/rocksdb,tizzybec/rocksdb,dkorolev/rocksdb,norton/rocksdb,vashstorm/rocksdb,luckywhu/rocksdb,vmx/rocksdb,tsheasha/rocksdb,dkorolev/rocksdb,caijieming-baidu/rocksdb,NickCis/rocksdb,geraldoandradee/rocksdb,wat-ze-hex/rocksdb,mbarbon/rocksdb,facebook/rocksdb,JohnPJenkins/rocksdb,NickCis/rocksdb,tsheasha/rocksdb,wenduo/rocksdb,wskplho/rocksdb,bbiao/rocksdb,Applied-Duality/rocksdb,ylong/rocksdb,Andymic/rocksdb,makelivedotnet/rocksdb,RyanTech/rocksdb,kaschaeffer/rocksdb,Vaisman/rocksdb,ylong/rocksdb,norton/rocksdb,Applied-Duality/rocksdb,virtdb/rocksdb,lgscofield/rocksdb,SunguckLee/RocksDB,sorphi/rocksdb,virtdb/rocksdb,kaschaeffer/rocksdb,virtdb/rocksdb,facebook/rocksdb,wlqGit/rocksdb,ylong/rocksdb,fengshao0907/rocksdb,JackLian/rocksdb,vashstorm/rocksdb,JohnPJenkins/rocksdb,ryneli/rocksdb,tsheasha/rocksdb,vashstorm/rocksdb,RyanTech/rocksdb,tizzybec/rocksdb,bbiao/rocksdb,tizzybec/rocksdb,vashstorm/rocksdb,Applied-Duality/rocksdb,bbiao/rocksdb,wenduo/rocksdb,dkorolev/rocksdb,wskplho/rocksdb,zhangpng/rocksdb,JackLian/rocksdb,NickCis/rocksdb,kaschaeffer/rocksdb,tsheasha/rocksdb,wat-ze-hex/rocksdb,IMCG/RcoksDB,kaschaeffer/rocksdb,luckywhu/rocksdb,jalexanderqed/rocksdb,flabby/rocksdb,JohnPJenkins/rocksdb,jalexanderqed/rocksdb,skunkwerks/rocksdb,vashstorm/rocksdb,IMCG/RcoksDB,makelivedotnet/rocksdb,msb-at-yahoo/rocksdb,makelivedotnet/rocksdb,Vaisman/rocksdb,temicai/rocksdb,msb-at-yahoo/rocksdb,Andymic/rocksdb,mbarbon/rocksdb,sorphi/rocksdb,virtdb/rocksdb,rDSN-Projects/rocksdb.replicated