You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Yin Huai (JIRA)" <ji...@apache.org> on 2012/11/19 15:34:58 UTC

[jira] [Created] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Yin Huai created AVRO-1208:
------------------------------

             Summary: Improve Trevni's performance on row-oriented data access
                 Key: AVRO-1208
                 URL: https://issues.apache.org/jira/browse/AVRO-1208
             Project: Avro
          Issue Type: Improvement
    Affects Versions: 1.7.3
            Reporter: Yin Huai


Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.

This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500515#comment-13500515 ] 

Doug Cutting commented on AVRO-1208:
------------------------------------

This sounds like it could be a useful optimization.

A way to implement this might be as a Trevni Input implementation:

http://avro.apache.org/docs/current/api/java/org/apache/trevni/Input.html

This optimization might be an Input that wraps another Input.  A ~1MB buffer should provide significant improvement.  When the first 64kB request is made, 1MB could be read into the buffer and its first 64kB could be returned.  Subsequent requests that are within the buffer could be resolved without any i/o.

It would be good to have a benchmark to validate this.  Do you have a relevant Trevni benchmark?
                
> Improve Trevni's performance on row-oriented data access
> --------------------------------------------------------
>
>                 Key: AVRO-1208
>                 URL: https://issues.apache.org/jira/browse/AVRO-1208
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.3
>            Reporter: Yin Huai
>
> Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.
> This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Posted by "Yin Huai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500268#comment-13500268 ] 

Yin Huai commented on AVRO-1208:
--------------------------------

A simple way to moderate this issue is to provide a prefeching mechanism. Users and upper-layer applications can ask Trevni to prefetch certain number of blocks.

btw, if you think this improvement is valid, I can work on this jira.
                
> Improve Trevni's performance on row-oriented data access
> --------------------------------------------------------
>
>                 Key: AVRO-1208
>                 URL: https://issues.apache.org/jira/browse/AVRO-1208
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.3
>            Reporter: Yin Huai
>
> Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.
> This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500518#comment-13500518 ] 

Doug Cutting commented on AVRO-1208:
------------------------------------

And, yes, it would be great if you'd like to work on this.
                
> Improve Trevni's performance on row-oriented data access
> --------------------------------------------------------
>
>                 Key: AVRO-1208
>                 URL: https://issues.apache.org/jira/browse/AVRO-1208
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.3
>            Reporter: Yin Huai
>
> Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.
> This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Posted by "Yin Huai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500543#comment-13500543 ] 

Yin Huai commented on AVRO-1208:
--------------------------------

ok. I will start to work on it.
                
> Improve Trevni's performance on row-oriented data access
> --------------------------------------------------------
>
>                 Key: AVRO-1208
>                 URL: https://issues.apache.org/jira/browse/AVRO-1208
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.3
>            Reporter: Yin Huai
>
> Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.
> This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1208) Improve Trevni's performance on row-oriented data access

Posted by "Yin Huai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501433#comment-13501433 ] 

Yin Huai commented on AVRO-1208:
--------------------------------

Yes, I have a benchmark right now. It is available at https://github.com/yhuai/tableplacement. In tableplacement-experiment/expScripts, read.Trevni.sh and
write.Trevni.sh can be used to write and read a file with the format of Trevni. 

I just did a quick test. The table I used has 6 int columns, the value of which is randomly picked from 0 to 9999, 6 string columns, the length of each string is 30, and 1 map column, the size of which is 10. The type of keys in the map column is string and the length of each key string is 4. The value type of values in the map column is int and every int value is randomly picked from 0 to 2147483646.

For a table with 3000000 rows (about 900MB, no compression), the throughput of a entire table scan is about 55 MB/s. The sequential access throughput of my disk is about 150 MB/s (sudo hdparm -t /dev/sda).

                
> Improve Trevni's performance on row-oriented data access
> --------------------------------------------------------
>
>                 Key: AVRO-1208
>                 URL: https://issues.apache.org/jira/browse/AVRO-1208
>             Project: Avro
>          Issue Type: Improvement
>    Affects Versions: 1.7.3
>            Reporter: Yin Huai
>
> Trevni uses an 64KB internal buffer to store values of a column. When accessing a column, it reads 64KB (if we do not consider compression and checksum) data from the storage layer. However, when the table is accessed in a row-oriented fashion (a entire row needs to be handed over to the upper layer), in the worst case (a full table scan and values of this table are all the same size), every 64KB data read can cause a seek.
> This jira is used to discuss if we should consider the data access pattern mentioned above and if so, how to improve the performance of Trevni. Row-oriented data processing engines, e.g. Hive, can benefit from this work.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira