Answered step by step
Verified Expert Solution
Question
1 Approved Answer
select l _ returnflag, l _ linestatus, sum ( l _ quantity ) as sum _ qty , sum ( l _ extendedprice ) as
select
lreturnflag,
llinestatus,
sumlquantity as sumqty
sumlextendedprice as sumbaseprice,
sumlextendedpriceldiscount as sumdiscprice,
sumlextendedpriceldiscountltax as sumcharge,
avglquantity as avgqty
avglextendedprice as avgprice,
avgldiscount as avgdisc,
count as countorder
from
scalelineitem
where
lshipdate date interval day
group by
lreturnflag,
llinestatus
order by
lreturnflag,
llinestatus;
this is the query plan based on the query above:
Finalize GroupAggregate cost rows width
Group Key: lreturnflag, llinestatus
Gather Merge cost rows width
Workers Planned:
Sort cost rows width
Sort Key: lreturnflag, llinestatus
Partial HashAggregate cost rows width
Group Key: lreturnflag, llinestatus
Parallel Seq Scan on lineitem cost rows width
Filter: lshipdate ::::timestamp without time zone
Provide an sketch of a query plan for the columnbased approach using late materialization.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started