Skip to content

Instantly share code, notes, and snippets.

@minmaxdata
Last active September 19, 2019 23:17
Show Gist options
  • Save minmaxdata/eea7c61cbdbab5cee13eff1dc2ca3c54 to your computer and use it in GitHub Desktop.
Save minmaxdata/eea7c61cbdbab5cee13eff1dc2ca3c54 to your computer and use it in GitHub Desktop.
HRR40 SDC Queries and results
Mac Book Pro
MacBook Pro (Retina, 13-inch, Mid 2014)
Processor 2.6 GHz Intel Core i5
8 GB 1600 MHz DDR3
POSTGRES
testdb=# EXPLAIN ANALYZE SELECT * FROM testschema.listing;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
Seq Scan on listing (cost=0.00..214433.65 rows=10001565 width=59) (actual time=1.003..2149.797 rows=9999996 loops=1)
Planning Time: 0.454 ms
Execution Time: 2838.850 ms
(3 rows)
Time: 2856.850 ms (00:02.857)
testdb=# SELECT COUNT(1) FROM testschema.listing WHERE cityId = '27';
count
-------
148
(1 row)
Time: 695.392 ms
testdb=# SELECT COUNT(1) FROM testschema.listing WHERE cityId = '15280';
count
-------
152
(1 row)
Time: 699.942 ms
testdb=# SELECT * FROM testschema.listing WHERE listingId = '11117';
listingid | listingname | photoid | cityid | cost | stars | reviews | type | label
-----------+-------------+---------+--------+------+-------+---------+--------------+------------
11117 | ab et | 958 | 15280 | 142 | 4 | 159 | Private Room | Listing
(1 row)
Time: 0.663 ms
testdb=# SELECT * FROM testschema.photo WHERE photoId = '958';
photoid | url | label
------------+--------------------------------------------------------------+------------
958 | https://hrr40-sdc1.s3-us-west-2.amazonaws.com/images/957.jpg | Photo
(1 row)
Time: 0.815 ms
NEO4J
MATCH (l:Listing) RETURN l LIMIT 100;
Started streaming 100 records after 18 ms and completed after 89 ms.
MATCH (l:Listing) RETURN l ORDER by l.listingId LIMIT 100;
Started streaming 100 records after 21 ms and completed after 53234 ms.
MATCH (l:Listing) WHERE l.cityId ="61835" RETURN l LIMIT 100;
Started streaming 100 records after 11 ms and completed after 20616 ms.
MATCH p=(c:City)-[r:NEARBY]->(l:Listing) RETURN p LIMIT 100;
Started streaming 100 records after 2 ms and completed after 96 ms.
MATCH p=(c:City)-[r:NEARBY]->(l:Listing) WHERE c.cityId="63185" RETURN p LIMIT 100
Started streaming 100 records after 105 ms and completed after 181 ms.
MATCH (house:Listing {listingId: '9000000'})
RETURN house
{
"cost": "355",
"reviews": "496",
"photoId": "971",
"listingId": "9000000",
"listingName": "alias sit",
"cityId": "78",
"stars": "5",
"type": "Private Room"
}
Started streaming 1 records after 1 ms and completed after 10 ms.
MATCH (photo:Photo) RETURN photo.url
Started streaming 1002 records after 1 ms and completed after 10 ms.
MATCH (:City { cityId: '17' })-->(listing) RETURN listing.listingName
Started streaming 99389 records after 2 ms and completed after 36787 ms.
"officiis dolor"
"ullam exercitationem"
"soluta quia"
"magnam non"
"repellat nulla"
"sit id"
"doloribus ullam"
"quod praesentium
"odio aut"
"laudantium sapiente"
"sed nulla"
"quia quia"
"aut amet"
"aut quis"
"nam nihil"
"ea quia"
....
MATCH (n) WHERE EXISTS(n.cityId) RETURN DISTINCT "node" as entity, n.cityId AS cityId LIMIT 25 UNION ALL MATCH ()-[r]-() WHERE EXISTS(r.cityId) RETURN DISTINCT "relationship" AS entity, r.cityId AS cityId LIMIT 25
Started streaming 25 records after 24607 ms and completed after 24609 ms.
entity cityId
"node" "0"
"node" "1"
"node" "2"
"node" "3"
"node" "4"
"node" "5"
"node" "6"
"node" "7"
"node" "8"
"node" "9"
"node" "10"
"node" "11"
"node" "12"
"node" "13"
"node" "14"
"node" "15"
"node" "16"
"node" "17"
"node" "18"
"node" "19"
"node" "20"
"node" "21"
"node" "22"
"node" "23"
"node" "24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment