Subject | Using INSERT to check for row existence |
---|---|
Author | Adrian Pronk |
Post date | 2001-04-29T23:42:34Z |
I thought I'd be clever, and instead of checking for the existence of a row
in a table, I simply INSERT the row anyway and wait for an error.
What I didn't expect was that I would get the error condition two seconds
later!
I'm using IB 6.0 on Linux and Interclient 1.6. When I issue the offending
INSERT, two seconds goes by before the SQLException comes back. The table
I'm referencing has 7 columns, a Primary key consisting of two columns, 6
foreign key constraints and seven million rows. The database has been
backed-up/restored less than a week ago, so it shouldn't be disorganised.
Does anybody have any clues as to why the insertion failure should take so
long?
--
Adrian
in a table, I simply INSERT the row anyway and wait for an error.
What I didn't expect was that I would get the error condition two seconds
later!
I'm using IB 6.0 on Linux and Interclient 1.6. When I issue the offending
INSERT, two seconds goes by before the SQLException comes back. The table
I'm referencing has 7 columns, a Primary key consisting of two columns, 6
foreign key constraints and seven million rows. The database has been
backed-up/restored less than a week ago, so it shouldn't be disorganised.
Does anybody have any clues as to why the insertion failure should take so
long?
--
Adrian