Re: File full error in simple select statement
Posted by: Peter Brawley
Date: May 11, 2021 12:57PM

Before you get to spending money on this ...

1 the tmp table generated by your query has 23M rows, the table rowcounts are 350K and 800, ie there are 280M possible combinations so your join hits about 8% of all possible row combinations from the two tables, does that sound about right?

2 Let's see the actual result of ...

EXPLAIN select
  w.weekend,
  d2.code as family,
  sum(ifnull(d2.amount, 0)) as owing 
from weekendings w 
join dr02 d2 on (w.weekend >= d2.date and d2.t1 <> "g") 
             or (w.weekend >= d2.weekend and d2.t1 = "g")
group by w.weekend, d2.code;

... and of ...

EXPLAIN select weekend, family, sum(amount) as owing
from (
  select w.weekend, d2.code as family, d2.amount
  from weekendings w  
  join dr02        d2 on (w.weekend >= d2.date and d2.t1 <> "g") 
                      or (w.weekend >= d2.weekend and d2.t1 = "g")
  where d2.code = "smi1" and d2.amount is not null
) x
group by weekend, family
order by weekend, family;

3 What proportion of dr02.amount values are null?

Options: ReplyQuote


Subject
Written By
Posted
Re: File full error in simple select statement
May 11, 2021 12:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.