Skip to content

Commit

Permalink
Remove use_inheritance_ctes flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwpark committed Jul 11, 2024
1 parent 7c8352d commit 787dce7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 24 deletions.
5 changes: 0 additions & 5 deletions edb/edgeql/compiler/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ class GlobalCompilerOptions:
#: the query plan.
is_explain: bool = False

#: Should type inheritance be expanded using CTEs.
#: When not explaining CTEs can be used to provide access to a type and its
#: descendents.
use_inheritance_ctes: bool = True

#: The name that can be used in a "DML is disallowed in ..."
#: error. When this is not None, any DML should cause an error.
in_ddl_context_name: Optional[str] = None
Expand Down
8 changes: 1 addition & 7 deletions edb/edgeql/compiler/typegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,7 @@ def type_to_typeref(
include_children = (
expr_type is s_types.ExprType.Update
or expr_type is s_types.ExprType.Delete
or (
(
env.options.is_explain or
env.options.use_inheritance_ctes
)
and isinstance(t, s_objtypes.ObjectType)
)
or isinstance(t, s_objtypes.ObjectType)
)
include_ancestors = (
expr_type is s_types.ExprType.Insert
Expand Down
2 changes: 0 additions & 2 deletions edb/pgsql/compiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def compile_ir_to_sql_tree(
named_param_prefix: Optional[tuple[str, ...]] = None,
expected_cardinality_one: bool = False,
is_explain: bool = False,
use_inheritance_ctes: bool = False,
external_rvars: Optional[
Mapping[Tuple[irast.PathId, pgce.PathAspect], pgast.PathRangeVar]
] = None,
Expand Down Expand Up @@ -129,7 +128,6 @@ def compile_ir_to_sql_tree(
ignore_object_shapes=ignore_shapes,
explicit_top_cast=explicit_top_cast,
is_explain=is_explain,
use_inheritance_ctes=use_inheritance_ctes,
singleton_mode=singleton_mode,
scope_tree_nodes=scope_tree_nodes,
external_rvars=external_rvars,
Expand Down
2 changes: 0 additions & 2 deletions edb/pgsql/compiler/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ def __init__(
ignore_object_shapes: bool,
singleton_mode: bool,
is_explain: bool,
use_inheritance_ctes: bool,
explicit_top_cast: Optional[irast.TypeRef],
query_params: List[irast.Param],
type_rewrites: Dict[RewriteKey, irast.Set],
Expand All @@ -569,7 +568,6 @@ def __init__(
self.ignore_object_shapes = ignore_object_shapes
self.singleton_mode = singleton_mode
self.is_explain = is_explain
self.use_inheritance_ctes = use_inheritance_ctes
self.explicit_top_cast = explicit_top_cast
self.query_params = query_params
self.type_rewrites = type_rewrites
Expand Down
6 changes: 4 additions & 2 deletions edb/pgsql/compiler/relctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ def range_for_material_objtype(
# using a CTE. This allows postgres to actually give us back the
# alias names that we use for relations, which we use to track which
# parts of the query are being referred to.
not ctx.env.use_inheritance_ctes
ctx.env.is_explain

# Don't use CTEs if there is no inheritance. (ie. There is only a
# single material type)
Expand Down Expand Up @@ -2206,7 +2206,9 @@ def _range_for_component_ptrref(
)

if (
not ctx.env.use_inheritance_ctes
# If explaining, expand inheritance directly as a union of pointers.
# See range for typerefs for more information.
ctx.env.is_explain

# Don't use CTEs if there is no inheritance. (ie. There is only a
# single ptrref)
Expand Down
6 changes: 0 additions & 6 deletions edb/server/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,11 +1701,6 @@ def _get_compile_options(
allow_user_specified_id=_get_config_val(
ctx, 'allow_user_specified_id') or ctx.schema_reflection_mode,
is_explain=is_explain,
use_inheritance_ctes=(
not is_explain
and not ctx.bootstrap_mode
and not ctx.schema_reflection_mode
),
testmode=_get_config_val(ctx, '__internal_testmode'),
schema_reflection_mode=(
ctx.schema_reflection_mode
Expand Down Expand Up @@ -1891,7 +1886,6 @@ def _compile_ql_query(
output_format=_convert_format(ctx.output_format),
backend_runtime_params=ctx.backend_runtime_params,
is_explain=options.is_explain,
use_inheritance_ctes=options.use_inheritance_ctes,
detach_params=(use_persistent_cache
and cache_mode is config.QueryCacheMode.PgFunc),
versioned_stdlib=True,
Expand Down

0 comments on commit 787dce7

Please sign in to comment.