<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Active Directory Users Query is Slow in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/74611#M2503</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/14947"&gt;@isaachimanga﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on my research, it seems that Query Folding is not supported. Try to change the sequence of the last two steps and check if it helps.&lt;/P&gt;&lt;PRE&gt;let
    Source = ActiveDirectory.Domains("domain.com"),
    #"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"],
    #"select user table" = #"records"{[Category="user"]}[Objects],
    #"filter top" = Table.SelectColumns(
        #"select user table",
        {"top"}),
    #"get principal name" = Table.ExpandRecordColumn(
        #"filter top", 
        "top", {"msDS-PrincipalName"}, 
        {"Principal Name"})
in
    #"get principal name"&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Oct 2016 03:52:46 GMT</pubDate>
    <dc:creator>v-chuncz-msft</dc:creator>
    <dc:date>2016-10-04T03:52:46Z</dc:date>
    <item>
      <title>Active Directory Users Query is Slow</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/73759#M2469</link>
      <description>&lt;P&gt;The query below takes 30-60 seconds for 10k users, consuming a lot of processor and network bandwith while it runs.&amp;nbsp; Is there a faster way to write this query?&amp;nbsp; I suspect that I am downloading the entire set of tables in #"records" but I am not sure how to select the user table directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let
    Source = ActiveDirectory.Domains("domain.com"),
    #"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"],
    #"select user table" = #"records"{[Category="user"]}[Objects],
    #"get principal name" = Table.ExpandRecordColumn(
        #"select user table", 
        "top", {"msDS-PrincipalName"}, 
        {"Principal Name"}),
    #"filter principal name" = Table.SelectColumns(
        #"get principal name",
        {"Principal Name"})
in
    #"filter principal name"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 15:26:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/73759#M2469</guid>
      <dc:creator>isaachimanga</dc:creator>
      <dc:date>2016-09-30T15:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Active Directory Users Query is Slow</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/74611#M2503</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/14947"&gt;@isaachimanga﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on my research, it seems that Query Folding is not supported. Try to change the sequence of the last two steps and check if it helps.&lt;/P&gt;&lt;PRE&gt;let
    Source = ActiveDirectory.Domains("domain.com"),
    #"records" = Source{[Domain="sub.domain.com"]}[#"Object Categories"],
    #"select user table" = #"records"{[Category="user"]}[Objects],
    #"filter top" = Table.SelectColumns(
        #"select user table",
        {"top"}),
    #"get principal name" = Table.ExpandRecordColumn(
        #"filter top", 
        "top", {"msDS-PrincipalName"}, 
        {"Principal Name"})
in
    #"get principal name"&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Oct 2016 03:52:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/74611#M2503</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2016-10-04T03:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Active Directory Users Query is Slow</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/74943#M2543</link>
      <description>&lt;P&gt;Thanks for the suggestion, unfortunatelly it didn't appear to load any faster, or if it did the difference smaller than the variation in just running the same query twice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 19:00:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Active-Directory-Users-Query-is-Slow/m-p/74943#M2543</guid>
      <dc:creator>isaachimanga</dc:creator>
      <dc:date>2016-10-04T19:00:18Z</dc:date>
    </item>
  </channel>
</rss>

