exec_tlist_length

Started by Bruce Momjianalmost 28 years ago2 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Vadim (or anyone else), can you comment on the use of
exec_tlist_length() vs. ExecTargetListLength(). This was changed in
Mariposa by removing the first one.

The first is called only in the planner.c, and computes the length as:

len = 0;
foreach(tl, targetlist)
{
curTle = lfirst(tl);

if (curTle->resdom != NULL)
len++;
}
return len;

while ExecTargetListLength() uses:

len = 0;
foreach(tl, targetlist)
{
curTle = lfirst(tl);

if (curTle->resdom != NULL)
len++;
else
len += curTle->fjoin->fj_nNodes;
}
return len;

The second counts resdom as one, or add fj_nNodes. Which is correct, or
are they used for different purposes. Seems like the second is more
correct.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)
#2Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#1)
Re: exec_tlist_length

Vadim (or anyone else), can you comment on the use of
exec_tlist_length() vs. ExecTargetListLength(). This was changed in
Mariposa by removing the first one.

The first is called only in the planner.c, and computes the length as:

len = 0;
foreach(tl, targetlist)
{
curTle = lfirst(tl);

if (curTle->resdom != NULL)
len++;
}
return len;

while ExecTargetListLength() uses:

len = 0;
foreach(tl, targetlist)
{
curTle = lfirst(tl);

if (curTle->resdom != NULL)
len++;
else
len += curTle->fjoin->fj_nNodes;
}
return len;

The second counts resdom as one, or add fj_nNodes. Which is correct, or
are they used for different purposes. Seems like the second is more
correct.

I have done some more research and found fj_nNodes is not used
(referenced in the FIXED_SETS code), so I have removed the first
function and make them all reference the second.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)