| From: | ChenhuiMo <chenhuimo(dot)mch(at)qq(dot)com> |
|---|---|
| To: | zhang ziming <toren(dot)zhang(at)outlook(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PATCH] postgres_fdw: Fix cost estimation for semi join pushdown |
| Date: | 2026-09-22 07:12:56 |
| Message-ID: | tencent_A256A58A7CFB3F9350FC6C2B991EAFBD550A@qq.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Ziming,
I reviewed v2, and the fix looks correct to me.
For JOIN_SEMI, joinclause_sel represents the fraction of outer rows
having a match, so using the outer row count here is consistent with
the selectivity semantics and the core semi-join size estimation.
The placement of the change also looks appropriate: it corrects the
row count used to charge remote_conds_cost, while retaining the
existing estimate for evaluating the join clauses. The path's output
row estimate still comes from foreignrel->rows.
The revised regression test looks useful, especially given your check
that reverting only the code change makes it fail. That gives it
coverage of this costing issue beyond checking that semi-join pushdown
is supported.
One small comment nit: the new comment refers to foreign_join_ok(),
but joinclause_sel is actually computed in
postgresGetForeignJoinPaths(). The reference to the local_conds
selectivity calculation in the commit message could be adjusted
similarly.
Apart from that, I have no further comments from code inspection.
I also applied the patch to my local PostgreSQL tree and ran
make check, which passed. Apart from the comment nit above, the
patch looks good to me.
One small request for future replies: please avoid quoting the entire
original message; keeping only the relevant parts would make the thread
easier to follow. Please also use English for replies, including "Re:"
rather than a localized subject prefix, so that everyone on the list
can follow the discussion.
Regards,
ChenHui Mo
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tatsuya Kawata | 2026-09-22 07:15:35 | Re: [PATCH] Add memory/disk usage for Function Scan nodes in EXPLAIN |
| Previous Message | Peter Eisentraut | 2026-09-22 07:10:23 | run pgindent in CI |