mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Allow CustomScan providers to say whether they support projections.
Previously, all CustomScan providers had to support projections, but there may be cases where this is inconvenient. Add a flag bit to say if it's supported. Important item for the release notes: this is non-backwards-compatible since the default is now to assume that CustomScan providers can't project, instead of assuming that they can. It's fail-soft, but could result in visible performance penalties due to adding unnecessary Result nodes. Sven Klemm, reviewed by Aleksander Alekseev; some cosmetic fiddling by me. Discussion: https://postgr.es/m/CAMCrgp1kyakOz6c8aKhNDJXjhQ1dEjEnp+6KNT3KxPrjNtsrDg@mail.gmail.com
This commit is contained in:
@@ -7046,6 +7046,10 @@ is_projection_capable_path(Path *path)
|
||||
case T_MergeAppend:
|
||||
case T_RecursiveUnion:
|
||||
return false;
|
||||
case T_CustomScan:
|
||||
if (castNode(CustomPath, path)->flags & CUSTOMPATH_SUPPORT_PROJECTION)
|
||||
return true;
|
||||
return false;
|
||||
case T_Append:
|
||||
|
||||
/*
|
||||
@@ -7092,6 +7096,10 @@ is_projection_capable_plan(Plan *plan)
|
||||
case T_MergeAppend:
|
||||
case T_RecursiveUnion:
|
||||
return false;
|
||||
case T_CustomScan:
|
||||
if (((CustomScan *) plan)->flags & CUSTOMPATH_SUPPORT_PROJECTION)
|
||||
return true;
|
||||
return false;
|
||||
case T_ProjectSet:
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user