mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Implement SQL-standard WITH clauses, including WITH RECURSIVE.
There are some unimplemented aspects: recursive queries must use UNION ALL (should allow UNION too), and we don't have SEARCH or CYCLE clauses. These might or might not get done for 8.4, but even without them it's a pretty useful feature. There are also a couple of small loose ends and definitional quibbles, which I'll send a memo about to pgsql-hackers shortly. But let's land the patch now so we can get on with other development. Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.117 2008/08/14 18:47:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.118 2008/10/04 21:56:53 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -408,10 +408,15 @@ match_unsorted_outer(PlannerInfo *root,
|
||||
* If the cheapest inner path is a join or seqscan, we should consider
|
||||
* materializing it. (This is a heuristic: we could consider it
|
||||
* always, but for inner indexscans it's probably a waste of time.)
|
||||
* Also skip it if the inner path materializes its output anyway.
|
||||
*/
|
||||
if (!(IsA(inner_cheapest_total, IndexPath) ||
|
||||
IsA(inner_cheapest_total, BitmapHeapPath) ||
|
||||
IsA(inner_cheapest_total, TidPath)))
|
||||
if (!(inner_cheapest_total->pathtype == T_IndexScan ||
|
||||
inner_cheapest_total->pathtype == T_BitmapHeapScan ||
|
||||
inner_cheapest_total->pathtype == T_TidScan ||
|
||||
inner_cheapest_total->pathtype == T_Material ||
|
||||
inner_cheapest_total->pathtype == T_FunctionScan ||
|
||||
inner_cheapest_total->pathtype == T_CteScan ||
|
||||
inner_cheapest_total->pathtype == T_WorkTableScan))
|
||||
matpath = (Path *)
|
||||
create_material_path(innerrel, inner_cheapest_total);
|
||||
|
||||
|
Reference in New Issue
Block a user