This is a discussion on RE: How to avoid a subquery in Informix?? within the Informix forums, part of the Database Server Software category; --> Is this just an example, or what you are really trying to do, if so why are you duplicating ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is this just an example, or what you are really trying to do, if so why are you duplicating data like this? How many rows in each table? What is the query plan (for that matter what OS and IDS version)? Do you have explicit indexes or are you using the implicit indexes created by the PK constraint? Have you updated statistics in a sensible manner? -> -----Original Message----- -> From: s_zhangnz@yahoo.co.nz [mailto:s_zhangnz@yahoo.co.nz] -> Sent: Thursday, May 20, 2004 6:45 AM -> To: informix-list@iiug.org -> Subject: How to avoid a subquery in Informix?? -> -> -> I have a job using subqueries. it is extrimely slow. So I want to -> remove the subquery, but it seems no way to do it in Informix? -> -> For example, there are 2 tables: tab1 and tab2, they have the same -> fields: ID and DESC, ID is the PK. The 2 tables have different data. -> If I want to update the records in tab2 to make the DESC equal to the -> corresponding DESC in tab1, I have to use the following query: -> -> Update tab2 -> set tab2.DESC = (select DESC from tab1 where tab1.ID = tab2.ID) -> where Exists -> (select * from tab1 where tab1.ID = tab2.ID) -> -> can somebody please advise me how to remove the 2 subqueries? -> -> Thanks a lot -> ************************************************** ******************************** This message is sent in strict confidence for the addressee only. It may contain legally privileged information. The contents are not to be disclosed to anyone other than the addressee. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. This footnote also confirms that this email message has been swept for the presence of computer viruses, however we cannot guarantee that this message is free from such problems. ************************************************** ******************************** sending to informix-list |