select * and select 1
Posted in 1997
Oscar Goldes — — source: Informix-list mailing list archive (1991-1998)
Hello, An application uses frequently the construction if exists (select * from ... where ....) to check if some record exists. I have been suggested to use instead if exists (select 1 from ... where ....) Two questions: 1. are the results totally equivalent? (regarding the "exists" ) 2. is the second form in any measurable way faster? (it seems to be) Engine is Informix OnLine 7.2. This happens inside a stored procedure, called from PowerBuilder, across a VSAT WAN (slow link, a lot of delay). We are trying to improve performance in every place where we can, so even a small improvement counts. Thanks in advance