Save 
Join IIUG
 for   
 

Informix News
18 Nov 13 - ZDNet - Top 20 mobile skills in demand... Read
09 Sep 13 - telecompaper - Shaspa and Tatung have shown a new smart home platform at Ifa in Berlin. Powered by the IBM Informix software... Read
06 Sep 13 - IBM data magazine - Mission Accomplished - Miami, Florida will be the backdrop for the 2014 IIUG Informix Conference... Read
01 Feb 13 - IBM Data Magazine - Are your database backups safe? Lester Knutsen (IBM Champion) writes about database back up safety using "archecker"... Read
14 Nov 12 - IBM - IBM's Big Data For Smart Grid Goes Live In Texas... Read
3 Oct 12 - The Financial - IBM and TransWorks Collaborate to Help Louisiana-Pacific Corporation Achieve Supply Chain Efficiency... Read
28 Aug 12 - techCLOUD9 - Splunk kicks up a SaaS Storm... Read
10 Aug 12 - businessCLOUD9 - Is this the other half of Cloud monitoring?... Read
3 Aug 12 - IBM data management - Supercharging the data warehouse while keeping costs down IBM Informix Warehouse Accelerator (IWA) delivers superior performance for in-memory analytics processing... Read
2 Aug 12 - channelbiz - Oninit Group launches Pay Per Pulse cloud-based service... Read
28 May 12 - Bloor - David Norfolk on the recent Informix benchmark "pretty impressive results"... Read
23 May 12 - DBTA - Informix Genero: A Way to Modernize Informix 4GL Applications... Read
9 Apr 12 - Mastering Data Management - Upping the Informix Ante: Advanced Data Tools... Read
22 Mar 12 - developerWorks - Optimizing Informix database access... Read
14 Mar 12 - BernieSpang.com - International Informix User Group set to meet in San Diego... Read
1 Mar 12 - IBM Data Management - IIUG Heads West for 2012 - Get ready for sun and sand in San Diego... Read
1 Mar 12 - IBM Data Management - Running Informix on Solid-State Drives.Speed Up Database Access... Read
26 Feb 12 - BernieSpan.com - Better results, lower cost for a broad set of new IBM clients and partners... Read
24 Feb 12 - developerWorks - Informix Warehouse Accelerator: Continuous Acceleration during Data Refresh... Read
6 Feb 12 - PRLOG - Informix port delivers unlimited database scalability for popular SaaS application ... Read
2 Feb 12 - developerWorks - Loading data with the IBM Informix TimeSeries Plug-in for Data Studio... Read
1 Feb 12 - developerWorks - 100 Tech Tips, #47: Log-in to Fix Central... Read
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Classics Forum

RE: Problem with query in SQL

Posted By: Willaert Doris
Date: Wednesday, 12 October 2016, at 2:53 a.m.

In Response To: Re: Problem with query in SQL (Jonathan Leffler)

IBM Informix Dynamic Server Version 12.10.FC2WE

The explain plan:

1) Query with no results

QUERY: (OPTIMIZATION TIMESTAMP: 10-12-2016 08:17:06)
------
SELECT orderlev.prodnr FROM orderlev
WHERE orderlev.prodnr in (SELECT prodnr FROM produkt, model, subgroep,
groep
where famnr = 14
AND groep.groepnr = subgroep.groepnr
AND subgroep.subgrnr = model.subgrnr
and model.modnr = produkt.modnr
and produkt.prodnr = orderlev.prodnr )

Estimated Cost: 512
Estimated # of Rows Returned: 2113

1) informix.groep: INDEX PATH

(1) Index Name: dorisw.i_groep03

Index Keys: famnr range (Serial, fragments: ALL)

Lower Index Filter: informix.groep.famnr = 14

2) informix.subgroep: INDEX PATH

(1) Index Name: dorisw.i_subgroep03

Index Keys: groepnr range (Serial, fragments: ALL)

Lower Index Filter: informix.groep.groepnr = informix.subgroep.groepnr
NESTED LOOP JOIN

REMOVE DUPLICATES

Remove Duplicates Keys:

3) informix.model: INDEX PATH

(1) Index Name: dorisw.i_model04

Index Keys: subgrnr range (Serial, fragments: ALL)

Lower Index Filter: informix.subgroep.subgrnr = informix.model.subgrnr
NESTED LOOP JOIN

REMOVE DUPLICATES

Remove Duplicates Keys:

4) informix.produkt: INDEX PATH

(1) Index Name: dorisw.i_produkt02

Index Keys: modnr optnr colnr trimnr (Serial, fragments: ALL)

Lower Index Filter: informix.model.modnr = informix.produkt.modnr
NESTED LOOP JOIN

5) informix.orderlev: INDEX PATH

(1) Index Name: root.i_orderlev03

Index Keys: prodnr fase (Key-Only) (Serial, fragments: ALL)

Lower Index Filter: informix.produkt.prodnr = informix.orderlev.prodnr
NESTED LOOP JOIN

Query statistics:
-----------------

Table map :
----------------------------
Internal name Table name
----------------------------
t1 groep
t2 subgroep
t3 model
t4 produkt
t5 orderlev

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t1 6 6 6 00:00.01 1

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t2 64 1272 64 00:00.02 1

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 64 24 00:00.03 26

type rows_sort est_rows rows_cons time
-------------------------------------------------
sort 1 47 64 00:00.03

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t3 0 2152 0 00:00.00 1

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 0 20 00:00.04 96

type rows_sort est_rows rows_cons time
-------------------------------------------------
sort 0 41 0 00:00.04

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t4 0 22971 0 00:00.00 2

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 0 217 00:00.04 170

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t5 0 229230 0 00:00.00 2

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 0 2113 00:00.04 513

2) Query with results :

Query statistics:
-----------------

Table map :
----------------------------
Internal name Table name
----------------------------
t1 groep
t2 subgroep
t3 model
t4 produkt
t5 orderlev

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t1 1 6 1 00:00.00 1

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t2 1 1272 1 00:00.00 1

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 1 47 00:00.01 17

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t3 4 2152 4 00:00.01 1

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 4 81 00:00.02 143

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t4 20 22971 20 00:00.01 2

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 20 852 00:00.04 376

type table rows_prod est_rows rows_scan time est_cost
-------------------------------------------------------------------
scan t5 1024 229230 1024 00:00.02 2

type rows_prod est_rows time est_cost
-------------------------------------------------
nljoin 1024 8499 00:00.06 1754

QUERY: (OPTIMIZATION TIMESTAMP: 10-12-2016 08:19:06)
------
SELECT orderlev.prodnr FROM orderlev
WHERE orderlev.prodnr in (SELECT prodnr FROM groep, subgroep , model,
produkt
where famnr = 14
AND groep.groepnr = subgroep.groepnr
AND subgroep.subgrnr = model.subgrnr
and model.modnr = produkt.modnr
and produkt.prodnr = orderlev.prodnr )

Estimated Cost: 1754
Estimated # of Rows Returned: 8498

1) informix.groep: INDEX PATH

(1) Index Name: dorisw.i_groep03

Index Keys: famnr range (Serial, fragments: ALL)

Lower Index Filter: informix.groep.famnr = 14

2) informix.subgroep: INDEX PATH

(1) Index Name: dorisw.i_subgroep03

Index Keys: groepnr range (Serial, fragments: ALL)

Lower Index Filter: informix.groep.groepnr = informix.subgroep.groepnr
NESTED LOOP JOIN

3) informix.model: INDEX PATH

(1) Index Name: dorisw.i_model04

Index Keys: subgrnr range (Serial, fragments: ALL)

Lower Index Filter: informix.subgroep.subgrnr = informix.model.subgrnr
NESTED LOOP JOIN

4) informix.produkt: INDEX PATH

(1) Index Name: dorisw.i_produkt02

Index Keys: modnr optnr colnr trimnr (Serial, fragments: ALL)

Lower Index Filter: informix.model.modnr = informix.produkt.modnr
NESTED LOOP JOIN

5) informix.orderlev: INDEX PATH

(1) Index Name: root.i_orderlev03

Index Keys: prodnr fase (Key-Only) (Serial, fragments: ALL)

Lower Index Filter: informix.produkt.prodnr = informix.orderlev.prodnr
NESTED LOOP JOIN

-----Original Message-----
From: classics-bounces@iiug.org [mailto:classics-bounces@iiug.org] On Behalf Of Jonathan Leffler
Sent: dinsdag 11 oktober 2016 20:01
To: classics@iiug.org

Subject: Re: Problem with query in SQL [4669]

>
> Notes interleaved below.

> On Tue, Oct 11, 2016 at 7:38 AM, DORIS WILLAERT <doris.willaert@alcopa.com>
> wrote:

>> ISQL version 7.51.FC1 on AIX 7.1
>>

> Which version of Informix are you connecting to? You might be able to run:

> SELECT

> DBINFO('version','full') FROM informix.systables WHERE tabid = 1;

> to get an answer. If that doesn't work, it also tells us something (likely
> you're using SE or a very antique version of IDS).

IBM Informix Dynamic Server Version 12.10.FC2WE

>> The following query doesn't give a result.
>>
>> SELECT orderlev.prodnr FROM orderlev
>> WHERE orderlev.prodnr in (SELECT prodnr FROM produkt, model, subgroep,
>> groep
>> where famnr = 14
>> AND groep.groepnr = subgroep.groepnr
>> AND subgroep.subgrnr = model.subgrnr
>> and model.modnr = produkt.modnr
>> and produkt.prodnr = orderlev.prodnr );
>>

> A correlated sub-query; ick. Are you sure that you can't rewrite this
> using the explicit JOIN notations?

>> When I change the order of the tables in the subquery I get results:
>>
>> SELECT orderlev.prodnr FROM orderlev
>> WHERE orderlev.prodnr in (SELECT prodnr FROM groep, subgroep , model,
>> produkt
>> where famnr = 14
>> AND groep.groepnr = subgroep.groepnr
>> AND subgroep.subgrnr = model.subgrnr
>> and model.modnr = produkt.modnr
>> and produkt.prodnr = orderlev.prodnr );
>>
>> Can anyone tell explain me this behaviour
>>

> One possibility is to us SET EXPLAIN ON and then examine the query plans
> reported in sqexplain.out.

> However, it seems likely to be a bug which is why the version number of
> the database server will be important. Your options are vastly different
> if you're using 12.10.FC5 from your options if you're using 7.31.UD6, for
> example.

> Note that ISQL is a separate product from the server and its version
> numbers are at best loosely related to those of the server. However, it is
> unlikely that the problem is in ISQL itself; this is almost certainly a
> server problem.

> --
> Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
> Guardian of DBD::Informix - v2015.1101 - http://dbi.perl.org
> "Blessed are we who can laugh at ourselves, for we shall never cease to be
> amused."

> --001a11411a3e634ea5053e9aa8dc

> *******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.

Messages In This Thread

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

Classics Forum is maintained by Administrator with WebBBS 5.12.