<?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>question Re: performance for views with union of different schema in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46924#M45062</link>
    <description>&lt;P&gt;Hi Maurin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both tables have to be scanned to observe SQL semantics. Otherwise, we would be changing the number of results coming out of your view. If you want the drop the second union operand, you could add a "WHERE a IS NOT NULL", and then the seocnd table will not be scanned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2016 00:41:25 GMT</pubDate>
    <dc:creator>alex.behm</dc:creator>
    <dc:date>2016-11-03T00:41:25Z</dc:date>
    <item>
      <title>performance for views with union of different schema</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46870#M45060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;quick question on performance, if I have 2 tables, the first one with columns "a,b" and the second one with columns "c,d" and I create a view like the following :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE VIEW my_view AS (
select a,b,null,null from table_1 
union 
select null,null,c,d from table_2)&lt;/PRE&gt;&lt;P&gt;Now if I do a simple query like :&lt;/P&gt;&lt;PRE&gt;select a from my_view&lt;/PRE&gt;&lt;P&gt;Will the query only read from table 1 or the entire table_2 will also be scanned?&amp;nbsp;&lt;BR /&gt;(I am mainly worried about disk reads)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 04:31:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46870#M45060</guid>
      <dc:creator>maurin</dc:creator>
      <dc:date>2016-11-02T04:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: performance for views with union of different schema</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46879#M45061</link>
      <description>&lt;P&gt;Hi maurin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you should be able to tell from the query profile. Run the query and then immediately after run "profile;" in the Impala shell to display the profile information, which will also contain information about the table scans. Feel free to post the profile here if you need help inspecting it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Lars&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 11:08:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46879#M45061</guid>
      <dc:creator>Lars Volker</dc:creator>
      <dc:date>2016-11-02T11:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: performance for views with union of different schema</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46924#M45062</link>
      <description>&lt;P&gt;Hi Maurin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both tables have to be scanned to observe SQL semantics. Otherwise, we would be changing the number of results coming out of your view. If you want the drop the second union operand, you could add a "WHERE a IS NOT NULL", and then the seocnd table will not be scanned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 00:41:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/performance-for-views-with-union-of-different-schema/m-p/46924#M45062</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2016-11-03T00:41:25Z</dc:date>
    </item>
  </channel>
</rss>

