tag:blogger.com,1999:blog-8899645800948009496.post1184715955736356704..comments2025-01-14T01:43:24.683-08:00Comments on DBMS Musings: Apache Arrow vs. Parquet and ORC: Do we really need a third Apache project for columnar data representation?Daniel Abadihttp://www.blogger.com/profile/16753133043157018521[email protected]Blogger17125tag:blogger.com,1999:blog-8899645800948009496.post-50611546165170217412020-12-02T01:34:19.727-08:002020-12-02T01:34:19.727-08:00Interesting read although I would avoid benching t...Interesting read although I would avoid benching tests on t2 AWS instance type as they have a concept of burst CPU credits, unless you explicitly set unlimited mode when you launched the instance then its possible that the machine ran out of CPU credits at some point during the experiment and altered your results. Probably did not alter much but for future experiments 💪<br />see Brent Cetinichhttps://www.blogger.com/profile/15867275358316545616[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-15469502315299249372019-08-01T10:21:42.500-07:002019-08-01T10:21:42.500-07:00Thanks for the comment. Like I said ... &quot;vas...Thanks for the comment.<br /><br />Like I said ... &quot;vast majority&quot;. You bring examples of column-stores. Sybase IQ is another historical example. But the vast majority of data engines were row-stores :)Daniel Abadihttps://www.blogger.com/profile/16753133043157018521[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-85194223796943757702019-07-31T18:31:55.637-07:002019-07-31T18:31:55.637-07:00&quot;For decades, the vast majority of data engin...&quot;For decades, the vast majority of data engines used row-oriented storage formats&quot;<br /><br />Well, that&#39;s not quite true. While speaking about decades and rows vs columns, APL, A+, J, K, Q, kdb+ should definitely be mentioned. Beloved pets of stock exchanges and power plant engineers for decades. Essentially columnar.Mobbcorehttps://www.blogger.com/profile/00669479442559791044[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-28973187165873654422019-05-22T13:14:56.506-07:002019-05-22T13:14:56.506-07:00Really good article ... thanks you Really good article ... thanks you durga prasad kumarhttps://www.blogger.com/profile/16943373589045068692[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-59021524921443016892018-10-22T05:24:16.008-07:002018-10-22T05:24:16.008-07:00Very interesting article and debate. Maybe using P...Very interesting article and debate. Maybe using Parquet/ORC in a RAM disk, taking into account the copying overhead of course, could contribute some more numbers to your debate.Anonymoushttps://www.blogger.com/profile/12037348274897213751[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-38188013525991339382018-03-28T18:27:16.307-07:002018-03-28T18:27:16.307-07:00Really nice article! Really nice article! RDhttps://www.blogger.com/profile/02270355407026813698[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-61806903960224826642018-01-10T08:53:48.172-08:002018-01-10T08:53:48.172-08:00Thanks for the reply. 1) Not necessarily for colu...Thanks for the reply.<br /><br />1) Not necessarily for column format, especially if the update layout is also using column format. Our experience has been that one can get do with 2-3X degradation with even large/frequent updates.<br /><br />2) Will defer to your experience.Anonymous[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-52361575983069383502018-01-08T16:18:17.399-08:002018-01-08T16:18:17.399-08:00Thanks for the comment and the more precise number...Thanks for the comment and the more precise numbers in several places. I do disagree about a couple of things though:<br /><br />(1) Updatability is mostly orthogonal to row vs. column. Both can dense-pack data if updates are not allowed, and both are more likely to use less read-optimal data layouts if updates are allowed. <br /><br />(2) Real world DB execution engines are more CPU intensive than what you indicate. (At least in my experience)Daniel Abadihttps://www.blogger.com/profile/16753133043157018521[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-84794654389270645992018-01-03T02:38:23.092-08:002018-01-03T02:38:23.092-08:00Good article but there are some important points m...Good article but there are some important points missed here.<br /><br />The most important being that row-oriented storage also implies one other thing: in all real world implementations row data is not packed contiguously like an array of C structs which this post implies (in absence of source code). That&#39;s because it has to allow updates/deletes to rows. Typical in-memory stores will use some form of hash map for in-memory cache. An interesting aside is that linked hash maps typically fare better in scans than normal or even open hash maps when row sizes are bit large (like &gt;100 bytes).<br /><br />Secondly row format allowing for varying column types also means that it has to maintain those offsets somewhere in schema and read those offsets while decoding thus additional reads are required breaking the cache lines further. On the other hand column format for primitive types have fixed sizes (or ones that can be read/jumped over in batches like run-length or efficient encodings like FastPFOR which are not possible with row format).<br /><br />All in all, raw speeds per core for a single integer/long in rows with 24 bytes sizes is ~50ns per row per core and typically more, and cannot become much better no matter what one does. Compared to that column formats can do &lt;1ns per row with/without encodings as the post also shows.<br /><br /><br />Some other points worth noting in the article and comments:<br /><br /><br />&quot;So even if the processor is doing a 4-byte integer comparison every single cycle, it is processing no more than 12GB a second&quot;<br /><br />Superscalar architecture can do like 4 instructions per cycle even without SIMD. Not sure about EC2 but on my laptop typically get &lt;1ns per integer/long (per core) for even average processing (which are more instructions than simple equals comparison). Adding additional filters on the same integer/long column hardly changes the numbers.<br /><br />&quot;But it is far less likely that we will see heavier-weight schemes like gzip and snappy in the Apache Arrow library any time soon&quot;<br /><br />Don&#39;t know about Apache Arrow, but compressing in memory means one can fit lot more in memory. Consider typical speed of decompression with schemes like LZ4 which is of the range of ~2GB/s compared to ~500MB/s disk reads even with SSDs, its a win in most scenarios (assuming no spare RAM for OS buffers).<br /><br /><br />&quot;However, for memory, the difference is usually less than an order of magnitude.&quot;<br /><br />Not true. Typical numbers are like ~4 cycles for L1, ~10 for L2, ~40 for L3 and ~100 or more for RAM. So the relative difference of sequential vs random is similar whether its disk or memory. Besides all parquet/ORC scanners will do sequential column block reads as far as possible, skipping forward in the same file as required.<br /><br /><br />&quot;On the other hand the amount of processing done per data item is tiny in this example; in a real system there is generally much more CPU overhead per data item.&quot;<br /><br />In typical queries, problem still remains the RAM/cache to CPU speed. For example even simple joins with reference data that fits in L1/L2 cache, the best hash joins will have to jump on the hash buckets and are typically an order of magnitude slower. Adding more filters, especially on primitives, hardly effects the numbers. For bigger joins the hits are even more (and of course, if a shuffle/sort gets introduced then those will completely dominate the numbers). The case where CPU matters are simple full scan queries with multiple complex filters but those are serviced much better using indexes.<br /><br /><br />&quot;I would say that there are fundamental differences between main-memory column-stores and disk-resident column-stores.&quot;<br /><br />Yet to find a main memory engine that can do significantly better than Spark+parquet, for example, especially if latter is stored uncompressed and file gets cached in OS buffers. The memory optimized engine we have built at SnappyData can go about 5-10X faster in the best cases, but less for complex queries. The bigger advantages lie elsewhere like indexing, minimizing shuffle, hybrid store etc.Anonymous[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-57693711277872338342018-01-03T02:05:24.012-08:002018-01-03T02:05:24.012-08:00This comment has been removed by the author.Anonymous[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-32012055406059431372017-11-08T17:48:05.228-08:002017-11-08T17:48:05.228-08:00Hope you can give more think about how to combine ...Hope you can give more think about how to combine the Disk-based format and the Memory-based format. <br /><br />From my experience, customers may want to cache data in memory, but the cost is so high, and want to put data back to disk if the resource is not enough. If one format can be flexible to support this, it maybe a good choose for users.DjvuLeehttps://www.blogger.com/profile/16536964965687282175[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-65562453403089792372017-11-08T17:40:32.188-08:002017-11-08T17:40:32.188-08:00Thanks for your reply! I agree with your conclusi...Thanks for your reply!<br /><br />I agree with your conclusion. Just the number you given can lead to the evidence is not so strong:-)<br /><br />I consider the same problem for a while, Do we really need the Apache Arrow project ? Thanks for this article!DjvuLeehttps://www.blogger.com/profile/16536964965687282175[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-47155415759806324002017-11-08T15:24:21.004-08:002017-11-08T15:24:21.004-08:00I said &quot;around 30GB&quot;. I was just trying ...I said &quot;around 30GB&quot;. I was just trying to give ballpark numbers rather than exact figures. <br /><br />As far as the number of CPU cores --- this post should be understood on a per-core basis. I agree that if there are many cores, all pulling data from memory at the same time, the bottleneck will be pushed back towards memory. On the other hand the amount of processing done per data item is tiny in this example; in a real system there is generally much more CPU overhead per data item. What I&#39;m trying to show in this article is that it is surprisingly easy for the CPU to become a bottleneck.Daniel Abadihttps://www.blogger.com/profile/16753133043157018521[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-32917401503988053342017-11-08T01:13:47.957-08:002017-11-08T01:13:47.957-08:00Nice article! but just a simple question: Why yo...Nice article! <br /><br />but just a simple question: Why you give the memory bandwidth from memory to CPU is 30GB. The DDR3-2133 is about 18.3 GB/s, DDR4-3200 is just about 25.6 GB/s. The number you give exaggerate the CPU process rate and memory bandwidth. What&#39;s more, there are lots of CPU cores in one machine, you just do not mention this enough.DjvuLeehttps://www.blogger.com/profile/16536964965687282175[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-70198202731695748642017-11-01T15:50:56.621-07:002017-11-01T15:50:56.621-07:00Yes, indeed, and you showed admirable restraint no...Yes, indeed, and you showed admirable restraint not making the example even more stark (it could have been 16 columns not 6, and the column of interest could have been 6 bits wide not 32) :-)Geoff Langdalehttps://www.blogger.com/profile/16627343305090330199[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-27196505250977182162017-11-01T13:15:20.502-07:002017-11-01T13:15:20.502-07:00Hi Geoff, What I was trying to say is that AVX2 o...Hi Geoff,<br /><br />What I was trying to say is that AVX2 or AVX512 is far less helpful for row-stores than column-stores, since in row-stores the register is polluted with data that will not be operated on.Daniel Abadihttps://www.blogger.com/profile/16753133043157018521[email protected]tag:blogger.com,1999:blog-8899645800948009496.post-13982632374650738952017-11-01T13:07:05.251-07:002017-11-01T13:07:05.251-07:00Is the fact that your benchmark example isn&#39;t ...Is the fact that your benchmark example isn&#39;t compute bound due to the instance not necessarily being capable of using a modern ISA? I would hope to be able to get 8-16 32-bit integer compares a cycle with AVX2 or AVX512 in the steady state (memory permitting; also branch misses permitting assuming we take a branch when we see something).Geoff Langdalehttps://www.blogger.com/profile/16627343305090330199[email protected]