Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. CREATE TYPE float3d AS (
  2. x real,
  3. y real,
  4. z real);
  5.  
  6. SELECT t1.id, t1.parent_id, (t1.location).x, (t1.location).y, (t1.location).z,
  7. t1.confidence, t1.radius, t1.skeleton_id, t1.user_id,
  8. t2.id, t2.parent_id, (t2.location).x, (t2.location).y, (t2.location).z,
  9. t2.confidence, t2.radius, t2.skeleton_id, t2.user_id
  10. FROM treenode t1
  11. INNER JOIN treenode t2 ON
  12. ( (t1.id = t2.parent_id OR t1.parent_id = t2.id)
  13. OR (t1.parent_id IS NULL AND t1.id = t2.id))
  14. WHERE (t1.LOCATION).z = 41000.0
  15. AND (t1.LOCATION).x > 2822.6
  16. AND (t1.LOCATION).x < 62680.2
  17. AND (t1.LOCATION).y > 33629.8
  18. AND (t1.LOCATION).y < 65458.6
  19. AND t1.project_id = 1 LIMIT 5000;
  20.  
  21. Column | Type | Modifiers
  22. ---------------+--------------------------+-------------------------------------------------------
  23. id | bigint | not null default nextval('location_id_seq'::regclass)
  24. user_id | integer | not null
  25. creation_time | timestamp with time zone | not null default now()
  26. edition_time | timestamp with time zone | not null default now()
  27. project_id | integer | not null
  28. location | float3d | not null
  29. editor_id | integer |
  30. parent_id | bigint |
  31. radius | real | not null default 0
  32. confidence | smallint | not null default 5
  33. skeleton_id | integer | not null
  34.  
  35. Indexes:
  36. "treenode_pkey" PRIMARY KEY, btree (id)
  37. "treenode_parent_id" btree (parent_id)
  38. "treenode_project_id_location_x_index" btree (project_id, ((location).x))
  39. "treenode_project_id_location_y_index" btree (project_id, ((location).y))
  40. "treenode_project_id_location_z_index" btree (project_id, ((location).z))
  41. "treenode_project_id_skeleton_id_index" btree (project_id, skeleton_id)
  42. "treenode_project_id_user_id_index" btree (project_id, user_id)
  43. "treenode_skeleton_id_index" btree (skeleton_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement