[sql] Fastest check if row exists in PostgreSQL