Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk> writes:
> ... the select appears to take much longer to complete if the WHERE clause
> matches zero rows, than if it matches some rows.
Doesn't make any sense to me. Are you sure the same plan is being
chosen in both cases? If so, could you post a complete example?
regards, tom lane