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

loc-id-triple-index.sql 1.3 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  1. DO $$
  2. DECLARE
  3. st_time timestamp;
  4. BEGIN
  5. RAISE NOTICE 'Indexing node IRIs' USING TABLE = 'locid.nodes';
  6. st_time := now();
  7. CREATE INDEX IF NOT EXISTS node_iri_idx ON locid.nodes (node_iri);
  8. ANALYZE locid.nodes;
  9. RAISE NOTICE 'Indexed node IRIs in %', now() - st_time;
  10. END;
  11. $$;
  12. DO $$
  13. DECLARE
  14. st_time timestamp;
  15. BEGIN
  16. RAISE NOTICE 'Adding literal PK' USING TABLE = 'locid.literals';
  17. st_time := now();
  18. ALTER TABLE locid.literals ADD CONSTRAINT literal_pkey PRIMARY KEY (lit_id);
  19. ANALYZE locid.literals;
  20. RAISE NOTICE 'Added literal PK in %', now() - st_time;
  21. END;
  22. $$;
  23. DO $$
  24. DECLARE
  25. st_time timestamp;
  26. BEGIN
  27. RAISE NOTICE 'Indexing authority subjects and objects' USING TABLE = 'locid.auth_triple';
  28. st_time := now();
  29. CREATE INDEX IF NOT EXISTS auth_subject_idx ON locid.auth_triple (subject_id);
  30. CREATE INDEX IF NOT EXISTS auth_object_idx ON locid.auth_triple (object_id);
  31. RAISE NOTICE 'Indexed authority table in %', now() - st_time;
  32. END;
  33. $$;
  34. DO $$
  35. DECLARE
  36. st_time timestamp;
  37. BEGIN
  38. RAISE NOTICE 'Indexing BIBFRAME work subjects and objects' USING TABLE = 'locid.work_triple';
  39. st_time := now();
  40. CREATE INDEX IF NOT EXISTS work_subject_idx ON locid.work_triple (subject_id);
  41. CREATE INDEX IF NOT EXISTS work_object_idx ON locid.work_triple (object_id);
  42. RAISE NOTICE 'Indexed BIBFRAME work table in %', now() - st_time;
  43. END;
  44. $$;
Tip!

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

Comments

Loading...