You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:03:07 UTC

[jira] [Updated] (SPARK-15302) Implement FK/PK "rely novalidate" constraints for better CBO

     [ https://issues.apache.org/jira/browse/SPARK-15302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon updated SPARK-15302:
---------------------------------
    Labels: bulk-closed  (was: )

> Implement FK/PK "rely novalidate" constraints for better CBO
> ------------------------------------------------------------
>
>                 Key: SPARK-15302
>                 URL: https://issues.apache.org/jira/browse/SPARK-15302
>             Project: Spark
>          Issue Type: New Feature
>          Components: Optimizer, Spark Core
>    Affects Versions: 2.0.0
>            Reporter: Ruslan Dautkhanov
>            Priority: Major
>              Labels: bulk-closed
>
> Oracle has "RELY NOVALIDATE" option for constraints.. Could be easier for Hive to start with something like that for PK/FK constraints. So CBO has more information for optimizations. It does not have to actually check if that constraint is relationship is true; it can just "rely" on that constraint.
> RELY clause:
> https://docs.oracle.com/database/121/SQLRF/clauses002.htm#SQLRF52223
> "Overview of Constraint States":
> https://docs.oracle.com/database/121/DWHSG/schemas.htm#DWHSG9053
> - Enforcement
> - Validation
> - Belief
> So FK/PK with "rely novalidate" will have Enforcement&Validate disabled but Belief = RELY as it is possible to do in Oracle and now in Hive (HIVE-13076).
> It opens a lot of ways to do additional ways to optimize execution plans.
> As explained in Tom Kyte's "Metadata matters"
> http://www.peoug.org/wp-content/uploads/2009/12/MetadataMatters_PEOUG_Day2009_TKyte.pdf
> pp.30 - "Tell us how the tables relate and we can remove them from the plan...".
> pp.35 - "Tell us how the tables relate and we have more access paths available...".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org