473,799 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Explain output question

I have the following SQL with explain
Should I be concerned with the merge cond: Merge Cond:
(("outer".maske d_acct_id)::tex t = "inner"."?colum n5?")? I have no idea
what column5 is or the same token the column6 shown later.

explain
select fed.indiv_fkey,
SUM(agg.purch_d ollars) as val_purch_store ,
SUM(agg.no_visi ts) as cnt_visit_store ,
SUM(CASE x.gmmid when 1 Then agg.purch_dolla rs else 0 end) as
Store_GMM1_Jewe lryn,
SUM(CASE x.gmmid when 2 Then agg.purch_dolla rs else 0 end) as
Store_GMM2_CCn,
SUM(CASE x.gmmid when 3 Then agg.purch_dolla rs else 0 end) as
Store_GMM3_Beau tyn,
SUM(CASE x.gmmid when 4 Then agg.purch_dolla rs else 0 end) as
Store_GMM4_RTWn ,
SUM(CASE x.gmmid when 5 Then agg.purch_dolla rs else 0 end) as
Store_GMM5_Mens n,
SUM(CASE x.gmmid when 6 Then agg.purch_dolla rs else 0 end) as
Store_GMM6_Home n,
SUM(CASE x.gmmid when 7 Then agg.purch_dolla rs else 0 end) as
Store_GMM7_Furn ituren,
SUM(CASE x.gmmid when 8 Then agg.purch_dolla rs else 0 end) as
Store_GMM8_Othe rn,
SUM(CASE when x.gmmid is null Then agg.purch_dolla rs else 0 end) as
Store_GMM_NotMa ppedn
from cdm.cdm_fedcust omer fed
inner join cdm.cdm_fed_agg _purch agg
on fed.masked_acct _id = agg.masked_acct _id
inner join cdm.cdm_fed_agg _deptxreff x
on (agg.dept_key = x.dept_key and agg.fed_div = x.div)
where agg.fed_div in ('MCE','MCW','B UR','BON','RLG' )
group by 1;

GroupAggregate (cost=6510420.2 7..6562483.23 rows=650787 width=27)
-> Sort (cost=6510420.2 7..6512047.23 rows=650787 width=27)
Sort Key: fed.indiv_fkey
-> Merge Join (cost=6010047.0 4..6447580.84 rows=650787
width=27)
Merge Cond: (("outer".maske d_acct_id)::tex t =
"inner"."?colum n5?")
-> Index Scan using fedcust_maskeda ctt_idx on
cdm_fedcustomer fed (cost=0.00..411 831.29 rows=6377392 width=29)
-> Sort (cost=6010047.0 4..6011674.00 rows=650787
width=39)
Sort Key: (agg.masked_acc t_id)::text
-> Merge Join (cost=5738556.1 6..5947207.61
rows=650787 width=39)
Merge Cond: ((("outer".div) ::text =
"inner"."?colum n6?") AND ("outer".dept_k ey = "inner".dept_ke y))
-> Index Scan using fadept_div_idx on
cdm_fed_agg_dep txreff x (cost=0.00..206 .23 rows=5294 width=15)
-> Sort (cost=5738556.1 6..5805859.79
rows=26921450 width=46)
Sort Key: (agg.fed_div):: text,
agg.dept_key
-> Seq Scan on cdm_fed_agg_pur ch agg
(cost=0.00..146 9685.99 rows=26921450 width=46)
Filter: (((fed_div)::te xt =
'MCE'::text) OR ((fed_div)::tex t = 'MCW'::text) OR ((fed_div)::tex t =
'BUR'::text) OR ((fed_div)::tex t = 'BON'::text) OR ((fed_div)::tex t =
'RLG'::text))


TIA
Patrick Hatcher
Macys.Com

Nov 23 '05 #1
2 1776
Patrick Hatcher <PH******@macys .com> writes:
Should I be concerned with the merge cond: Merge Cond:
(("outer".maske d_acct_id)::tex t = "inner"."?colum n5?")? I have no idea
what column5 is or the same token the column6 shown later.


You should be able to figure that out by correlating the plan with the
original query. In this case the inner column is clearly
agg.masked_acct _id since there is nothing else that fed.masked_acct _id
would be joined to.

It's annoying that EXPLAIN isn't always able to deliver a reasonable
text representation of values that have bubbled up from a lower plan
level. I've so far not found a good fix, but it's on the to-think-about
list ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
thank you. I thought it was correct but just wanted to make sure.
Patrick Hatcher
Macys.Com


Tom Lane <tg*@sss.pgh.pa .us>
10/08/04 11:34 AM

To
Patrick Hatcher <PH******@macys .com>
cc
pg***********@p ostgresql.org
Subject
Re: [GENERAL] Explain output question


Patrick Hatcher <PH******@macys .com> writes:
Should I be concerned with the merge cond: Merge Cond:
(("outer".maske d_acct_id)::tex t = "inner"."?colum n5?")? I have no idea
what column5 is or the same token the column6 shown later.


You should be able to figure that out by correlating the plan with the
original query. In this case the inner column is clearly
agg.masked_acct _id since there is nothing else that fed.masked_acct _id
would be joined to.

It's annoying that EXPLAIN isn't always able to deliver a reasonable
text representation of values that have bubbled up from a lower plan
level. I've so far not found a good fix, but it's on the to-think-about
list ...

regards, tom lane
Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2472
by: C++fan | last post by:
The following code is for list operation. But I can not understand. Could anyone explain the code for me? /* * List definitions. */ #define LIST_HEAD(name, type) struct name { type *lh_first; /* first element */
14
20398
by: Ina Schmitz | last post by:
Hello all, I don't succeed in displaying the explain plan. I use IBM DB2 Universal Database 8.2. I tried to do the example given in the online help for "Visual Explain". The tables EXPLAIN_STATEMENT and EXPLAIN_INSTANCE exist. With VESAMPL.DDL, I loaded the predefined execution plans. In the next step, I'ld like to display the loaded access plans. So, I right clicked on "Show Explained Statements History" and got the result:
22
2117
by: Jaspreet | last post by:
I was recently asked this question in an interview. Unfortunately I was not able to answer it and the interviewer made a decision on my C strengths (or weekness) based on this single question and that was a sad end to my interview. Here is the program: #include <stdio.h> int main() { char *c ="abc";
9
1758
by: Abhishek | last post by:
Yet another option is to use pointers to arrays: int (*array4) = malloc(nrows * sizeof(*array4)); or even int (*array5) = malloc(sizeof(*array5)); Please explain the declaration of the multidimension array as shown above.
5
8116
by: kabotnet | last post by:
Hi, I'm new in db2, I'm trying to execute EXPLAIN command on some queries but i have error like: And message similar to: Token EXPLAIN is not valid, valid tokens ( END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER. I've created tables explain_* How can I start to find solution? Is it possible that my db2 doesn't support explain?
1
2406
by: td0g03 | last post by:
Hello, I am new to C and I am new to English. I not sure what palindromes mean. I don't know exactly what my teacher wants me to do. If someone could explain it to me in a different way that would be great. I know its sorta long, but maybe you only have to few the first few paragraphs. Problem: Write a program in C that generates number palindromes using the algorithm below (see 3. on the next page) and allows the user to try this...
7
2051
by: Mike Kent | last post by:
It's often useful for debugging to print something to stderr, and to route the error output to a file using '2>filename' on the command line. However, when I try that with a python script, all prompt output from raw_input goes to stderr. Consider the following test program: === Start test.py === import sys
3
1902
by: lenygold via DBMonster.com | last post by:
Total Cost: 43.712 Query Degree: 1 Rows RETURN ( 1) Cost I/O | 3.44
0
2780
by: LanaR | last post by:
Hello, one sql statement is causing severe performance issue. The problem occurs only in UDB environment, the same statemnt on the mainframe is running fine. I have an explain output from the sql. The statement itself is not that complicated, it is 3 selects and union all. Explain output is pretty big, but I could not find anything unusual. I'm new to db2 and I could be missing stuff. I am posting the explain output below and I really...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.