Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

SQL Timeout when filtering a view

(0) ShareShare
ReportReport
Posted on by 10

When filtering a view (adding the filter in the column) for contacts we do get SQL timeout error.

pastedimage1677237648703v1.png

However, it works when displaying the main view which shows all records.

And also works when doing an advanced find and adding same filter as applied in teh view

We display only 50 records per page,

Filtering the view seems to apply filter to all data, and not only a subsets of records, i woudl expect it retreives only a subset whish are the ones that will be displaye in teh view.

This is the featchXml call that fails, (no related entities)

/api/data/v9.0/contacts?fetchXml=<fetch version="1.0" output-format="xml-platform" mapping="logical" no-lock="false" returntotalrecordcount="true" page="1" count="50"><entity name="contact"><attribute name="entityimage_url"/><attribute name="parent_contactid"/><attribute name="fullname"/><attribute name="emailaddress1"/><attribute name="parentcustomerid"/><attribute name="telephone1"/><attribute name="statecode"/><attribute name="contactid"/><attribute name="sector"/><attribute name="segment"/><filter type="and"><condition attribute="sector" operator="eq" value="866140001"/>

  • Suggested answer
    RE: SQL Timeout when filtering a view

    Try to remove them, it should solve the timeout issue. If the tables have millions of records, a full table scan will cause a timeout.

    Thank you.

  • JorgeSR Profile Picture
    JorgeSR 10 on at
    RE: SQL Timeout when filtering a view

    Yes, using calculated columns

  • Verified answer
    RE: SQL Timeout when filtering a view

    Hello Jose, are you aware if any of this fields is a Computed Column or has a Leading wildcard? If yes, try to remove it or not add that as filter.

    For awareness, Computed Columns (and it's the same for Leading WC) are fields that are calculated on the fly, even before the filter is applied, which will always trigger a full table scan. It’s an expected behavior or by design.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans