Unix Technical Forum

RE: How to avoid a subquery in Informix??

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:27 PM
Simmons, Keith
 
Posts: n/a
Default RE: How to avoid a subquery in Informix??


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com