Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

load-clusters.sql 1.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  1. DROP TABLE IF EXISTS loc_isbn_cluster CASCADE;
  2. CREATE TABLE loc_isbn_cluster (
  3. isbn_id INTEGER NOT NULL,
  4. cluster INTEGER NOT NULL
  5. );
  6. \copy loc_isbn_cluster FROM 'data/loc-clusters.csv' WITH (FORMAT CSV);
  7. ALTER TABLE loc_isbn_cluster ADD PRIMARY KEY (isbn_id);
  8. CREATE INDEX loc_isbn_cluster_idx ON loc_isbn_cluster (cluster);
  9. ANALYZE loc_isbn_cluster;
  10. DROP TABLE IF EXISTS ol_isbn_cluster CASCADE;
  11. CREATE TABLE ol_isbn_cluster (
  12. isbn_id INTEGER NOT NULL,
  13. cluster INTEGER NOT NULL
  14. );
  15. \copy ol_isbn_cluster FROM 'data/ol-clusters.csv' WITH (FORMAT CSV);
  16. ALTER TABLE ol_isbn_cluster ADD PRIMARY KEY (isbn_id);
  17. CREATE INDEX ol_isbn_cluster_idx ON ol_isbn_cluster (cluster);
  18. ANALYZE ol_isbn_cluster;
  19. DROP TABLE IF EXISTS isbn_cluster CASCADE;
  20. CREATE TABLE isbn_cluster (
  21. isbn_id INTEGER NOT NULL,
  22. cluster INTEGER NOT NULL
  23. );
  24. \copy isbn_cluster FROM 'data/isbn-clusters.csv' WITH (FORMAT CSV);
  25. ALTER TABLE isbn_cluster ADD PRIMARY KEY (isbn_id);
  26. CREATE INDEX isbn_cluster_idx ON isbn_cluster (cluster);
  27. ANALYZE isbn_cluster;
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...