Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
korni@sietec.de — — source: Informix-list mailing list archive (1991-1998)
Hi all,
I try to do the following tricky thing:
I've got a table and a tmp_table with the same column definitions. The index
has a unique key *composited* of field1 and field2 and indexes on every field.
I want to delete every row from table whose key (composed from
field1 and field2) is contained in tmp_table.
A lot of 'simple' approaches failed because of the composition
of the unique key, that I don't want to duplicate into a table field
due to space considerations.
Here's a (seemingly) working statement:
delete from table where
(
( table.field1 = any(select tmp_table.field1 from tmp_table where
tmp_table.field1 = table.field1 )
) and
( table.field2 = any(select tmp_table.field2 from tmp_table where
tmp_table.field2 = table.field2 )
)
)
This works but is awful slow (seems to be quadratic on rows of table).
Is there any better way ?
Any help appreciated (mail preferred).
Thanks in advance,
Jochen
--
Jochen Kornitzky <URL:http://www.sietec.de/staff/korni/>
Sietec GmbH & Co. OHG EMAIL: FON: +49-30-386 28125
D-13629 Berlin (Germany) korni@sietec.de FAX: +49-30-386 28321
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.