alamb commented on issue #15177:
URL: https://github.com/apache/datafusion/issues/15177#issuecomment-2717477809

   BTW apparently DuckDB uses the "late materialization" technique with its own 
native format. Here is an explain courtesy of Joe Issacs and Robert Kruszewski
   
   ```
   ┌─────────────────────────────┐
   │┌───────────────────────────┐│
   ││       Physical Plan       ││
   │└───────────────────────────┘│
   └─────────────────────────────┘
   ┌───────────────────────────┐
   │         PROJECTION        │
   │    ────────────────────   │
   │             #0            │
   │__internal_decompress_integ│
   │    ral_smallint(#1, 0)    │
   │             #2            │
   │__internal_decompress_integ│
   │    ral_smallint(#3, 1)    │
   │             #4            │
   │             #5            │
   │             #6            │
   │             #7            │
   │             #8            │
   │             #9            │
   │__internal_decompress_integ│
   │    ral_smallint(#10, 0)   │
   │__internal_decompress_integ│
   │    ral_smallint(#11, 0)   │
   │__internal_decompress_integ│
   │    ral_smallint(#12, 0)   │
   │            #13            │
   │            #14            │
   │            ...            │
   │            #90            │
   │            #91            │
   │            #92            │
   │            #93            │
   │            #94            │
   │            #95            │
   │            #96            │
   │            #97            │
   │            #98            │
   │            #99            │
   │            #100           │
   │__internal_decompress_integ│
   │   ral_smallint(#101, 0)   │
   │            #102           │
   │            #103           │
   │            #104           │
   │                           │
   │       ~99997497 Rows      │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │          ORDER_BY         │
   │    ────────────────────   │
   │    memory.main.hits_tb    │
   │       .EventTime ASC      │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │         PROJECTION        │
   │    ────────────────────   │
   │             #0            │
   │__internal_compress_integra│
   │     l_utinyint(#1, 0)     │
   │             #2            │
   │__internal_compress_integra│
   │     l_utinyint(#3, 1)     │
   │             #4            │
   │             #5            │
   │             #6            │
   │             #7            │
   │             #8            │
   │             #9            │
   │__internal_compress_integra│
   │     l_utinyint(#10, 0)    │
   │__internal_compress_integra│
   │     l_utinyint(#11, 0)    │
   │__internal_compress_integra│
   │     l_utinyint(#12, 0)    │
   │            #13            │
   │            #14            │
   │            ...            │
   │            #90            │
   │            #91            │
   │            #92            │
   │            #93            │
   │            #94            │
   │            #95            │
   │            #96            │
   │            #97            │
   │            #98            │
   │            #99            │
   │            #100           │
   │__internal_compress_integra│
   │    l_utinyint(#101, 0)    │
   │            #102           │
   │            #103           │
   │            #104           │
   │                           │
   │       ~99997497 Rows      │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │         PROJECTION        │
   │    ────────────────────   │
   │          WatchID          │
   │         JavaEnable        │
   │           Title           │
   │         GoodEvent         │
   │         EventTime         │
   │         EventDate         │
   │         CounterID         │
   │          ClientIP         │
   │          RegionID         │
   │           UserID          │
   │        CounterClass       │
   │             OS            │
   │         UserAgent         │
   │            URL            │
   │          Referer          │
   │            ...            │
   │      ParamCurrencyID      │
   │    OpenstatServiceName    │
   │     OpenstatCampaignID    │
   │        OpenstatAdID       │
   │      OpenstatSourceID     │
   │         UTMSource         │
   │         UTMMedium         │
   │        UTMCampaign        │
   │         UTMContent        │
   │          UTMTerm          │
   │          FromTag          │
   │          HasGCLID         │
   │        RefererHash        │
   │          URLHash          │
   │            CLID           │
   │                           │
   │       ~99997497 Rows      │
   └─────────────┬─────────────┘
   ┌─────────────┴─────────────┐
   │         HASH_JOIN         │
   │    ────────────────────   │
   │      Join Type: SEMI      │
   │                           │
   │        Conditions:        ├──────────────┐
   │       rowid = rowid       │              │
   │                           │              │
   │       ~99997497 Rows      │              │
   └─────────────┬─────────────┘              │
   ┌─────────────┴─────────────┐┌─────────────┴─────────────┐
   │         SEQ_SCAN          ││           TOP_N           │
   │    ────────────────────   ││    ────────────────────   │
   │       Table: hits_tb      ││          Top: 10          │
   │   Type: Sequential Scan   ││                           │
   │                           ││         Order By:         │
   │        Projections:       ││    memory.main.hits_tb    │
   │            URL            ││       .EventTime ASC      │
   │          WatchID          ││                           │
   │         JavaEnable        ││                           │
   │           Title           ││                           │
   │         GoodEvent         ││                           │
   │         EventTime         ││                           │
   │         EventDate         ││                           │
   │         CounterID         ││                           │
   │          ClientIP         ││                           │
   │          RegionID         ││                           │
   │           UserID          ││                           │
   │        CounterClass       ││                           │
   │             OS            ││                           │
   │         UserAgent         ││                           │
   │            ...            ││                           │
   │      ParamCurrencyID      ││                           │
   │    OpenstatServiceName    ││                           │
   │     OpenstatCampaignID    ││                           │
   │        OpenstatAdID       ││                           │
   │      OpenstatSourceID     ││                           │
   │         UTMSource         ││                           │
   │         UTMMedium         ││                           │
   │        UTMCampaign        ││                           │
   │         UTMContent        ││                           │
   │          UTMTerm          ││                           │
   │          FromTag          ││                           │
   │          HasGCLID         ││                           │
   │        RefererHash        ││                           │
   │          URLHash          ││                           │
   │            CLID           ││                           │
   │                           ││                           │
   │       ~99997497 Rows      ││                           │
   └───────────────────────────┘└─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │         PROJECTION        │
                                │    ────────────────────   │
                                │             #1            │
                                │             #2            │
                                │                           │
                                │       ~19999499 Rows      │
                                └─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │           FILTER          │
                                │    ────────────────────   │
                                │  contains(URL, 'google')  │
                                │                           │
                                │       ~19999499 Rows      │
                                └─────────────┬─────────────┘
                                ┌─────────────┴─────────────┐
                                │         SEQ_SCAN          │
                                │    ────────────────────   │
                                │       Table: hits_tb      │
                                │   Type: Sequential Scan   │
                                │                           │
                                │        Projections:       │
                                │            URL            │
                                │         EventTime         │
                                │                           │
                                │          Filters:         │
                                │ optional: Dynamic Filter  │
                                │        (EventTime)        │
                                │                           │
                                │       ~99997497 Rows      │
                                └───────────────────────────┘
   ```


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to