Peter <peter@xxxxxxxxxxxxxxxx> writes: >> Try SELECT count(*) FROM ... instead and see if the times are closer. > Correct. That executes in 300ms flat: So your problem is data transfer, not the query per se. How old a pgAdmin are you using? regards, tom lane