Advertisement
NLinker

Calculate hashes for resolver tables for the first 100k

Feb 23rd, 2017
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT '' AS tn, '' AS md5
  2. UNION SELECT 'apple_mapping', md5(CAST((array_agg(t.* ORDER BY entity_uuid)) AS TEXT))
  3.       FROM (SELECT entity_uuid, external_id, entity_type, is_deleted FROM apple_mapping ORDER BY id LIMIT 100000) t
  4. UNION SELECT 'spotify_mapping', md5(CAST((array_agg(t.* ORDER BY entity_uuid)) AS TEXT))
  5.       FROM (SELECT entity_uuid, external_id, entity_type, is_deleted FROM spotify_mapping ORDER BY id LIMIT 100000) t
  6. UNION SELECT 'internal_mapping', md5(CAST((array_agg(t.* ORDER BY id)) AS TEXT))
  7.       FROM (SELECT id, from_uuid, to_uuid, entity_type FROM internal_mapping ORDER BY id LIMIT 100000) t
  8. UNION SELECT 'apple_song_metadata_hash', md5(CAST((array_agg(t.* ORDER BY id)) AS TEXT))
  9.       FROM (SELECT id, hash, uuid FROM apple_song_metadata_hash ORDER BY id LIMIT 100000) t
  10. ORDER BY tn;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement