Is there way to keep query time constant as the database size grows.
No. More data == more time. Unless you find a way to break the laws of physics.
Straight hash-table indexes (which Postgres doesn't use) have O(1) access time. The amount of data has no effect on the access time. Postgres uses B-trees which have O(logN) performance. There is no "law of physics" that says Postgres couldn't employ pure hash indexes.
Craig
Should I use partitioning or partial indexes?
Neither technique is a magic bullet. I doubt either would help here. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532) mobile: 512-569-9461