title: USQL nested query performance
body: <p>I have a USQL query that runs fine on it's own against 400M records in a managed table.
  But during development, I don't want to run it against all records all the time, so I pop a where clause in, run it for a tiny subsection of data, and it completes in around 2 minutes (@5 AUs), writing out results to a tsv in my data lake.
  Happy with that.</p>
  
  <p>However, I now want to use it as the source for a second query and further processing.
  So I create a view with the original USQL (minus the where clause).
  Then to test, a new script :  </p>
  
  <pre><code>'Select * from MyView WHERE &lt;my original test filter&gt;'.
  </code></pre>
  
  <p>Now I was expecting that to execute in around the same time as the original raw query. But instead I got to 4 minutes, only 10% through the plan,  and cancelled - something is not right.</p>
  
  <p>No expert at reading Job Graphs, but ...
  The original script kicks off with 2* 'Extract Combine partition' both reading a couple of hundered MBs,  my select on the saved View is reading over 100GB !!
  So it is not taking the where clause into account at all at this stage.</p>
  
  <p>Obviously this shows how little I yet understand about how DLA works behind the scenes !</p>
  
  <p>Would someone please help me understand (a) what is going on and (b) a path forward to get the behavior I need ?</p>
  
  <p>Currently having a play with stored procedures to store the 1st result in a table and then call the second query against that - but just seems overkill compared with 'traditional' SQL Server ?!?</p>
  
  <p>All pointers &amp; hints appreciated !
  Many Thanks</p>
  
  <p><strong>Original Base Query:</strong></p>
  
  <pre><code>CREATE VIEW IF NOT EXISTS Play.[M3_CycleStartPoints]
  AS
  
  //@BASE = 
  SELECT ROW_NUMBER() OVER (PARTITION BY A.[CTNNumber] ORDER BY A.[SeqNo]) AS [CTNCycleNo], A.[CTNNumber], A.[SeqNo], A.[BizstepDescription], A.[ContainerStatus], A.[FillStatus]
  FROM 
   [Play].[RawData] AS A
   LEFT OUTER JOIN
       (
          SELECT [CTNNumber],[SeqNo]+1 AS [SeqNo],[FillStatus],[ContainerStatus],[BizstepDescription]
          FROM [Play].[RawData] 
          WHERE    [FillStatus] == "EMPTY" AND [AssetUsage] == "CYLINDER"
       ) AS B
             ON A.[CTNNumber] == B.[CTNNumber] AND A.[SeqNo] == B.[SeqNo]
  WHERE (
          (A.[FillStatus] == "FULL" AND 
           A.[AssetUsage] == "CYLINDER" AND 
           B.[CTNNumber] == A.[CTNNumber]
          ) OR (
           A.[SeqNo] == 1 
          )
        );
  
        //AND A.[CTNNumber] == "BE52XH7";   
        //Only used to test when running script as stand-alone &amp; output to tsv
  </code></pre>
  
  <p><strong>Second Query</strong></p>
  
  <pre><code>SELECT *
  FROM [Play].[M3_CycleStartPoints]
  WHERE [CTNNumber] == "BE52XH7";
  </code></pre>