I kept looking and the combination of parameters passed to the select that
seems to hang ($sth3) ends up returning NULL when I run it against the
development db.  Using

declare @date datetime
select @date = max(date)
from dbo.table3
where a = '020'
  and b = '451'
select @date

I've now been waiting for over 10min to see a result returned in
isql.  Any other combo of a and b that I know to be in the input causes a
return immediately.  Running a similar select (w/o all the declare
junk) against Informix, with a table with almost as many rows as its
Sybase counterpart, returns the select within less than a second.

I suspect I'll have to create some sort of hash containing the max dates
at the beginning of the program and then query against the hash later on.
Not the kind of overhead I'd want to deal with when the number of input
records is relatively small.

--Curt

Reply via email to