---
name: fabric-lakehouse-views-perf-remediate-a92a1f12f75d
description: Troubleshoot Microsoft Fabric materialized lake views (MLV) performance issues including slow refresh, incremental refresh failures, full refresh fallback, Spark job failures, lineage execution errors, data quality constraint violations, and optimal refresh configuration. Use when diagnosing MLV refresh duration, monitoring MLV runs in Monitor Hub, analyzing Spark logs for MLV failures, enabling change data feed (CDF), resolving delta table not found errors, or optimizing MLV query definitions for incremental refresh eligibility. Covers Spark SQL syntax, TBLPROPERTIES, PARTITIONED BY, CONSTRAINT CHECK ON MISMATCH DROP/FAIL, and custom environment configuration.
license: Complete terms in LICENSE.txt
---
# Fabric Materialized Lake Views Performance remediate

Diagnose and resolve performance issues with materialized lake views (MLVs) in Microsoft Fabric lakehouses. This skill covers refresh optimization, Spark job diagnostics, data quality constraint tuning, and lineage execution remediate.

## When to Use This Skill

- MLV refresh runs are taking longer than expected
- Incremental refresh is falling back to full refresh unexpectedly
- MLV lineage execution shows Failed or Skipped nodes
- Spark jobs for MLV refresh are failing with errors
- "Delta table not found" errors during MLV creation or refresh
- Data quality constraints causing unexpected pipeline failures
- Need to enable or verify optimal refresh configuration
- Custom Spark environment tuning for MLV workloads
- Monitoring and interpreting MLV run history

## Prerequisites

- Microsoft Fabric workspace with Lakehouse items
- Schema-enabled lakehouse (recommended for MLV support)
- Fabric notebook for executing Spark SQL commands
- Workspace Admin or Contributor role for scheduling and monitoring
- Access to Monitor Hub for viewing MLV run details

## Quick Diagnostics Checklist

Run through these checks in order when remediate MLV performance:

| Step | Check                 | Action                                                                    |
| ---- | --------------------- | ------------------------------------------------------------------------- |
| 1    | Identify refresh mode | Verify optimal refresh toggle is enabled in lineage view                  |
| 2    | Check CDF status      | Confirm `delta.enableChangeDataFeed=true` on ALL source tables          |
| 3    | Review query patterns | Ensure only supported SQL constructs are used (see supported expressions) |
| 4    | Inspect run history   | Open lineage view dropdown to see last 25 runs and their states           |
| 5    | Check node failures   | Click failed nodes in lineage to view error messages                      |
| 6    | Review Spark logs     | Follow Detailed Logs link to Monitor Hub for Spark error logs             |
| 7    | Validate data quality | Check if FAIL constraints are causing "delta table not found" errors      |
| 8    | Assess source data    | Determine if source has updates/deletes (forces full refresh)             |

## Step-by-Step Workflows

### Workflow 1: Diagnose Slow Refresh

1. **Determine current refresh strategy** - Navigate to Manage materialized lake views in the lakehouse ribbon. Check if Optimal refresh toggle is ON.
2. **Verify change data feed** - Run the diagnostic script to check CDF status on all source tables. See [scripts/check-cdf-status.sql](./scripts/check-cdf-status.sql).
3. **Check for unsupported expressions** - Review the MLV definition for constructs that force full refresh. See [Supported Expressions](#supported-expressions-for-incremental-refresh).
4. **Inspect source data patterns** - If source tables have UPDATE or DELETE operations, Fabric always performs full refresh regardless of CDF status.
5. **Review partition strategy** - Consider adding `PARTITIONED BY` to large MLVs to improve refresh parallelism.
6. **Attach custom environment** - Configure a custom Spark environment with optimized compute for heavy workloads. See [references/custom-environment-guide.md](./references/custom-environment-guide.md).

### Workflow 2: Resolve Failed Refresh Runs

1. **Open lineage view** - Navigate to Manage materialized lake views, select the failed run from the dropdown (last 25 runs available).
2. **Identify failed node** - Click the failed node in the lineage graph. Review the error message in the right-side panel.
3. **Access Spark logs** - Click the Detailed Logs link to navigate to Monitor Hub. Review Apache Spark error logs.
4. **Common failure patterns** - See [references/common-failure-patterns.md](./references/common-failure-patterns.md) for resolution steps.
5. **Retry or recreate** - For transient Spark failures, retry the run. For persistent errors, drop and recreate the MLV.

### Workflow 3: Enable Optimal Refresh

1. **Enable CDF on all source tables:**

```sql
ALTER TABLE bronze.customers SET TBLPROPERTIES (delta.enableChangeDataFeed = true);
ALTER TABLE bronze.orders SET TBLPROPERTIES (delta.enableChangeDataFeed = true);
```

2. **Verify CDF is enabled:**

```sql
DESCRIBE DETAIL bronze.customers;
-- Check properties column for delta.enableChangeDataFeed=true
```

3. **Create MLV with CDF property:**

```sql
CREATE OR REPLACE MATERIALIZED LAKE VIEW silver.customer_orders
TBLPROPERTIES (delta.enableChangeDataFeed=true)
AS
SELECT 
    c.customerID,
    c.customerName,
    c.region,
    o.orderDate,
    o.orderAmount
FROM bronze.customers c INNER JOIN bronze.orders o
ON c.customerID = o.customerID;
```

4. **Enable optimal refresh toggle** - Navigate to Manage materialized lake views and verify the Optimal refresh toggle is ON (enabled by default).

## Supported Expressions for Incremental Refresh

MLVs using only these constructs qualify for incremental refresh:

| SQL Construct            | Notes                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------- |
| `SELECT`               | Only deterministic built-in functions. Non-deterministic and window functions force full refresh. |
| `FROM`                 | Standard table references                                                                         |
| `WHERE`                | Only deterministic built-in functions                                                             |
| `INNER JOIN`           | Supported for incremental                                                                         |
| `WITH` (CTE)           | Common table expressions supported                                                                |
| `UNION ALL`            | Supported                                                                                         |
| `CONSTRAINT ... CHECK` | Only deterministic built-in functions in constraint conditions                                    |

**Unsupported constructs that force full refresh:**

- `LEFT JOIN`, `RIGHT JOIN`, `FULL OUTER JOIN`
- Window functions (`ROW_NUMBER`, `RANK`, `LAG`, `LEAD`, etc.)
- Non-deterministic functions (`current_timestamp()`, `rand()`, etc.)
- Subqueries in `SELECT` or `WHERE`
- `GROUP BY` with `HAVING`
- `DISTINCT`
- User-defined functions (UDFs)

## Key Spark SQL Reference

### List All MLVs

```sql
SHOW MATERIALIZED LAKE VIEWS IN silver;
```

### View MLV Definition

```sql
SHOW CREATE MATERIALIZED LAKE VIEW silver.customer_orders;
```

### Force Full Refresh

```sql
REFRESH MATERIALIZED LAKE VIEW silver.customer_orders FULL;
```

### Drop and Recreate

```sql
DROP MATERIALIZED LAKE VIEW silver.customer_orders;

CREATE OR REPLACE MATERIALIZED LAKE VIEW silver.customer_orders
TBLPROPERTIES (delta.enableChangeDataFeed=true)
AS
SELECT ...;
```

## Known Issues and Limitations

| Issue                                     | Impact                               | Workaround                                                   |
| ----------------------------------------- | ------------------------------------ | ------------------------------------------------------------ |
| FAIL constraint + "delta table not found" | MLV creation or refresh fails        | Recreate MLV using DROP action instead of FAIL               |
| Schema names with ALL CAPS                | MLV creation fails                   | Use lowercase or mixed-case schema names                     |
| Session-level Spark properties            | Not applied during scheduled refresh | Set properties in custom environment instead                 |
| Delta time travel in MLV definition       | Not supported                        | Remove `VERSION AS OF` or `TIMESTAMP AS OF` from queries |
| DML statements on MLVs                    | Not supported                        | MLVs are read-only; modify source tables instead             |
| UDFs in SELECT                            | Not supported                        | Use built-in Spark SQL functions                             |
| Temporary views as MLV source             | Not supported                        | Reference base tables or other MLVs directly                 |
| Cross-lakehouse lineage                   | Not supported                        | Keep all related MLVs within same lakehouse                  |
| Updating data quality constraints         | Not supported                        | Drop and recreate the MLV with new constraints               |
| LIKE/regex in constraint conditions       | Not supported                        | Use simple comparison operators in constraints               |
| Service principal authentication          | Not supported for MLV APIs           | Use Microsoft Entra user authentication                      |
| Single schedule per lineage               | UI instability if exceeded           | Maintain only one active schedule per lineage                |
| South Central US region                   | Feature not available                | Use a workspace in a different region                        |

## Run States Reference

| State       | Meaning                                       | Action                                         |
| ----------- | --------------------------------------------- | ---------------------------------------------- |
| Completed   | All nodes executed successfully               | No action needed                               |
| Failed      | One or more nodes failed; child nodes skipped | Review failed node error, check Spark logs     |
| Skipped     | Previous run still in progress                | Wait for current run to complete, or cancel it |
| In Progress | Run started, not yet terminal                 | Monitor progress in lineage view               |
| Canceled    | Manually canceled from Monitor Hub            | Re-trigger if needed                           |

## remediate

| Symptom                                           | Likely Cause                              | Resolution                                                                                   |
| ------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------- |
| Refresh always full, never incremental            | CDF not enabled on source tables          | Run `ALTER TABLE ... SET TBLPROPERTIES (delta.enableChangeDataFeed = true)` on ALL sources |
| Refresh always full despite CDF enabled           | Unsupported SQL constructs in MLV         | Review definition for window functions, LEFT JOIN, non-deterministic functions               |
| Refresh always full despite CDF and supported SQL | Source has UPDATE/DELETE operations       | Incremental only supports append-only; redesign ETL to be append-only or accept full refresh |
| "Delta table not found" on create                 | FAIL constraint issue                     | Recreate MLV without FAIL; use DROP action instead                                           |
| Node shows Skipped state                          | Parent node failed                        | Fix the parent node failure first                                                            |
| Schedule not running                              | Previous run still in progress            | Cancel the stuck run from Monitor Hub, or wait                                               |
| Environment not accessible                        | User lacks access to selected environment | Select an accessible environment from dropdown                                               |
| Deleted environment error                         | Associated environment was removed        | Choose a new environment in lineage settings                                                 |
| MLV names changed to lowercase                    | Expected behavior                         | MLV names are case-insensitive and stored as lowercase                                       |
| Workspace names with spaces cause errors          | Backtick syntax required                  | Use backtick notation:`` `My Workspace`.lakehouse.schema.view_name ``                        |

## References

- [Common Failure Patterns](./references/common-failure-patterns.md) - Detailed resolution for frequent MLV errors
- [Custom Environment Guide](./references/custom-environment-guide.md) - Spark environment tuning for MLV workloads
- [Monitoring Deep Dive](./references/monitoring-deep-dive.md) - Advanced Monitor Hub usage for MLV diagnostics
- [CDF Status Check Script](./scripts/check-cdf-status.sql) - T-SQL/Spark SQL script to audit CDF property
- [MLV Health Check Script](./scripts/mlv-health-check.sql) - Comprehensive MLV configuration audit
- [MLV Diagnostic Template](./templates/diagnostic-notebook.sql) - Notebook template for systematic MLV remediate


---
Source attribution: PatrickGallucci
Original project: https://github.com/PatrickGallucci/fabric-skills
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice


                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Dave AI resource metadata

Creator / publisher: PatrickGallucci
Original project: https://github.com/PatrickGallucci/fabric-skills
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Data & Analytics, Development & Engineering, Operations, Product Management
Roles: Business Process Analyst, Data Analyst, Data Engineer, ML / AI Engineer, Product Manager
Specialties: Backend, Database
Tools: Microsoft Fabric
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: f7f755012ae84180341ca3d315a8e70a25e8c253b9dce27805566bf4e25b3a1a
