Last active
March 6, 2019 19:26
-
-
Save andrewgeorgemitchell/98239f93f6a387096d58f37f569e1998 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## MySQL Read Queries | |
-- SELECT * FROM Songs as s | |
-- WHERE id = 10000000; | |
~ .1 ms | |
## MySQL Queries for related songs | |
-- SELECT * FROM Songs as s | |
-- LEFT JOIN Song_to_songs as sts | |
-- ON s.id = sts.songId | |
-- RIGHT JOIN Songs as s2 | |
-- ON s2.id = sts.relatedSongId | |
-- WHERE s.id = 1; | |
~ 7ms | |
## Neo4j Read queries | |
MATCH (s:Song { id: 10000000 }) | |
RETURN s | |
~ 6ms | |
## Neo4j Read Song by id, and grab all related songs, as well as the artist who made that song, and playlists and albums that the song is in | |
Match (user:User {id: 133})-[:CREATED]->(songs)-[:RELATED_TO]-(relatedSongs)-[:IS_IN]-(albums) | |
WITH user, songs, relatedSongs | |
MATCH (songs)-[:IS_IN]->(albums) | |
return user, songs, relatedSongs, albums | |
~ 6ms | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment