kmitchener commented on PR #3242:
URL: 
https://github.com/apache/arrow-datafusion/pull/3242#issuecomment-1224969592

   Given the above sql, it results in this plan. Isn't this 1 too many 
projections?
   
   ```
   create view v as select 1 as a, 2 as b, 3 as c;
   explain analyze select * from (select b from v);
   
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type         | plan                                                   
                                                                                
                                      |
   
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Plan with Metrics | CoalescePartitionsExec, metrics=[output_rows=1, 
elapsed_compute=72.1µs, spill_count=0, spilled_bytes=0, mem_used=0]             
                                             |
   |                   |   ProjectionExec: expr=[b@0 as b], 
metrics=[output_rows=1, elapsed_compute=3.311µs, spill_count=0, 
spilled_bytes=0, mem_used=0]                                              |
   |                   |     ProjectionExec: expr=[b@0 as b], 
metrics=[output_rows=1, elapsed_compute=5.511µs, spill_count=0, 
spilled_bytes=0, mem_used=0]                                            |
   |                   |       ProjectionExec: expr=[2 as b], 
metrics=[output_rows=1, elapsed_compute=53.011µs, spill_count=0, 
spilled_bytes=0, mem_used=0]                                           |
   |                   |         RepartitionExec: 
partitioning=RoundRobinBatch(12), metrics=[repart_time{inputPartition=0}=1ns, 
fetch_time{inputPartition=0}=27µs, send_time{inputPartition=0}=7.6µs] |
   |                   |           EmptyExec: produce_one_row=true, metrics=[]  
                                                                                
                                      |
   |                   |                                                        
                                                                                
                                      |
   
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to