Skip to content

Instantly share code, notes, and snippets.

@hannahsohkim
Last active May 1, 2019 06:13
Show Gist options
  • Save hannahsohkim/8fa1c1cf8f4187ce225f712452a2c289 to your computer and use it in GitHub Desktop.
Save hannahsohkim/8fa1c1cf8f4187ce225f712452a2c289 to your computer and use it in GitHub Desktop.
Bandland: Database queries and sample results

PostgreSQL

  • Query time for PostgreSQL database seeded with 10 million data points.
    id    | album_id |  name  |  artist  |                 image                 |      tags       |                                         description                                          
----------+----------+--------+----------+---------------------------------------+-----------------+----------------------------------------------------------------------------------------------
 10000039 |  9999999 | Jennie | mollitia | http://lorempixel.com/640/480/animals | Gregorian Chant | Iste qui asperiores mollitia enim. Cumque blanditiis id est et quam optio veritatis nostrum.
(1 row)

Time: 15.255 ms
bandland=# select * from albums where album_id = 9999999;
    id    | album_id |  name  |  artist  |                 image                 |      tags       |                                         description                                          
----------+----------+--------+----------+---------------------------------------+-----------------+----------------------------------------------------------------------------------------------
 10000039 |  9999999 | Jennie | mollitia | http://lorempixel.com/640/480/animals | Gregorian Chant | Iste qui asperiores mollitia enim. Cumque blanditiis id est et quam optio veritatis nostrum.
(1 row)

Time: 0.524 ms
bandland=# select * from albums where album_id = 9999999;
    id    | album_id |  name  |  artist  |                 image                 |      tags       |                                         description                                          
----------+----------+--------+----------+---------------------------------------+-----------------+----------------------------------------------------------------------------------------------
 10000039 |  9999999 | Jennie | mollitia | http://lorempixel.com/640/480/animals | Gregorian Chant | Iste qui asperiores mollitia enim. Cumque blanditiis id est et quam optio veritatis nostrum.
(1 row)

Time: 0.506 ms
bandland=# select * from albums where album_id = 9999999;
    id    | album_id |  name  |  artist  |                 image                 |      tags       |                                         description                                          
----------+----------+--------+----------+---------------------------------------+-----------------+----------------------------------------------------------------------------------------------
 10000039 |  9999999 | Jennie | mollitia | http://lorempixel.com/640/480/animals | Gregorian Chant | Iste qui asperiores mollitia enim. Cumque blanditiis id est et quam optio veritatis nostrum.
(1 row)

Time: 0.470 ms

Cassandra

  • Query time for Cassandra database seeded with 10 million data points.
cqlsh:bandland> select * from albums where album_id = 9999999;

 album_id | artist | description                                                            | image                                  | name       | tags
----------+--------+------------------------------------------------------------------------+----------------------------------------+------------+---------
  9999999 | Irving | Aut ipsum sed est veritatis sunt et dolorem quia. Eius hic quas nulla. | http://lorempixel.com/640/480/abstract | temporibus | Ambient

(1 rows)

Tracing session: 6d233220-6bd5-11e9-bedf-2f356e742de0

 activity                                                                             | timestamp                  | source    | source_elapsed | client
--------------------------------------------------------------------------------------+----------------------------+-----------+----------------+-----------
                                                                   Execute CQL3 query | 2019-04-30 22:53:21.474000 | 127.0.0.1 |              0 | 127.0.0.1
 Parsing select * from albums where album_id = 9999999; [Native-Transport-Requests-1] | 2019-04-30 22:53:21.483000 | 127.0.0.1 |           8869 | 127.0.0.1
                                    Preparing statement [Native-Transport-Requests-1] | 2019-04-30 22:53:21.488000 | 127.0.0.1 |          13841 | 127.0.0.1
                             Executing single-partition query on albums [ReadStage-2] | 2019-04-30 22:53:21.525000 | 127.0.0.1 |          51178 | 127.0.0.1
                                           Acquiring sstable references [ReadStage-2] | 2019-04-30 22:53:21.528000 | 127.0.0.1 |          53981 | 127.0.0.1
                                              Merging memtable contents [ReadStage-2] | 2019-04-30 22:53:21.531000 | 127.0.0.1 |          56477 | 127.0.0.1
                                 Bloom filter allows skipping sstable 8 [ReadStage-2] | 2019-04-30 22:53:21.631000 | 127.0.0.1 |         156600 | 127.0.0.1
                                 Bloom filter allows skipping sstable 7 [ReadStage-2] | 2019-04-30 22:53:21.635000 | 127.0.0.1 |         160595 | 127.0.0.1
                                 Bloom filter allows skipping sstable 6 [ReadStage-2] | 2019-04-30 22:53:21.639000 | 127.0.0.1 |         164711 | 127.0.0.1
                     Partition index with 0 entries found for sstable 5 [ReadStage-2] | 2019-04-30 22:53:21.870000 | 127.0.0.1 |         396409 | 127.0.0.1
                                 Read 1 live rows and 0 tombstone cells [ReadStage-2] | 2019-04-30 22:53:22.069000 | 127.0.0.1 |         595329 | 127.0.0.1
                                                                     Request complete | 2019-04-30 22:53:22.072983 | 127.0.0.1 |         598983 | 127.0.0.1
                                                                     ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment