You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Michael J. Carey (Jira)" <ji...@apache.org> on 2022/02/17 01:57:00 UTC

[jira] [Updated] (ASTERIXDB-2913) Need "break up to make up" rewrite rule for unnested data

     [ https://issues.apache.org/jira/browse/ASTERIXDB-2913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael J. Carey updated ASTERIXDB-2913:
----------------------------------------
    Fix Version/s: 0.9.8

> Need "break up to make up" rewrite rule for unnested data
> ---------------------------------------------------------
>
>                 Key: ASTERIXDB-2913
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2913
>             Project: Apache AsterixDB
>          Issue Type: Improvement
>            Reporter: Michael J. Carey
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.8
>
>
> Consider the following query using the Don Chamberlin book data:
>  _USE DonCData;_ 
>  _WITH flat_orders AS (SELECT orderno, custid, order_date, ship_date FROM orders),_
>             _flat_items AS (SELECT o.orderno, i.* FROM orders o, o.items i)_
>  _SELECT f__o.orderno, fo.custid, fo.order_date, fo.ship_date,_ _fi.* FROM flat_orders fo, flat_items fi_
>  _WHERE fo.orderno = fi.orderno;_
> Right now this query leads to two scans of orders - one for flat_orders and one for flat_items - followed by a join of the two.
> It seems like it should be possible to rewrite (under the hood) this query as simply:
> _USE DonCData;_ 
>  _SELECT o.orderno, o.custid, o.order_date, o.ship_date, i.*_  _FROM orders o, o.items i;_
> This capability could prove super-helpful in our future BI story.  (Picture two flat views being exported for JDBC - it would be nice to be able to piece them back together for efficient querying under the hood.)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)