On 09/19/2012 09:36 AM, A J wrote:
Probably, mostly. But the planner won't use an index for the first query but hopefully will on the second and the index may not be cached. If you have enough RAM and nothing contending for it then the OS will probably cache appropriately. But there are other optimizations you may want to consider like turning off atime on your disk (for Linux, in any case) to avoid requiring a write for every read. For simple read queries the connection setup time will become an issue so connection-pooling and persistent connections will be useful. Cheers, Steve |