PostgreSQL LTree - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

PostgreSQL LTree

Description:

Adjacency List. Nested Sets. Nested Intervals. Materialized Path. Adjacency List. 11. 10 ... Europe. 1.2. Countries. 1. Top. PATH. NAME. PostgreSQL ? LTree ... – PowerPoint PPT presentation

Number of Views:231
Avg rating:3.0/5.0
Slides: 22
Provided by: koubers
Category:

less

Transcript and Presenter's Notes

Title: PostgreSQL LTree


1
?????????? ????????? ? PostgreSQL ???????????
LTree
????? ??????? kouber_at_saparev.com
2
?????????? ?????????
3
????????
Top
Countries
Programming
Europe
Languages
Africa
Bulgaria
France
PHP
Marocco
Perl
4
?????? ?? ??????????? ?? ??????? ? ???? ?????
  • Adjacency List
  • Nested Sets
  • Nested Intervals
  • Materialized Path

5
Adjacency List
6
Nested Sets
Top
1
22
2
14
Countries
Programming
13
21
Africa
9
12
Europe
Languages
8
3
15
20
10
18
16
Bulgaria
PHP
Perl
France
Marocco
6
5
4
7
11
17
19
7
Nested Sets
8
Materialized Path
9
PostgreSQL ? LTree
http//www.sai.msu.su/megera/postgres/gist/ltree/
10
??????? ???????
  • ??????
  • ????????? ???
  • ?????? ?????
  • ????????
  • ???????
  • ????????? ??????
  • ???????

11
?????? ?????
  • ltree
  • ltree
  • lquery
  • ltxtquery

12
??????? ????????
  • lt,gt,lt,gt,, ltgt
  • ltree _at_gt ltree, ltree lt_at_ ltree
  • ltree lquery, lquery ltree
  • ltree ? lquery, lquery ? ltree
  • ltree _at_ ltxtquery, ltxtquery _at_ ltree
  • ltree ltree, ltree text, text ltree

13
???????
  • subltree, subpath
  • nlevel
  • index
  • text2ltree, ltree2text
  • lca

14
??????????? ?? ???????
  • SELECT
  • REPEAT(\t', NLEVEL(path)-1)name
  • FROM
  • hierarchy
  • ORDER BY
  • path USING lt

15
??????????? ?? ???????
  • Top
  • Countries
  • Europe
  • Bulgaria
  • France
  • Africa
  • Marocco
  • Programming
  • Languages
  • PHP
  • Perl

16
??? ?? ??????
  • SELECT
  • FROM
  • hierarchy
  • WHERE
  • path _at_gt '1.2.3.4'

17
??????????
  • SELECT
  • FROM
  • hierarchy
  • WHERE
  • path lt_at_ '1.8'

18
????????? ??????
  • ?????????
  • - ?????????? ???? ??????? (????)
  • N - ????? N ????
  • N, M - ?? N ?? M ????
  • , M - ???-????? M ????
  • ????????????
  • _at_ - ?????????????? ??? ?????????
  • - ?????????? ?? ???? ?? ??????
  • - ?? ????? ??? ???????? _

19
????????? ??????
  • Top.2,4.sport_at_.!volleyballtennis.SwBulgaria
  • b) c) d)
    e)
  • ??????? ? ??????? Top
  • ????????? ?? ??? ?? ?????? ???????
  • ? ??????, ???????? ? ?????????????? ??? ?????????
    ?????????? sport
  • ????????? ?? ????? ? ??????, ????? ?? ??????? ?
    volleyball ??? tennis
  • ? ?? ???????? ? ????? ? ??????, ???????? ??? Sw
    ??? ????? ???????? ? Bulgaria

20
???????
  • B-tree
  • ?? lt, lt, , gt, gt
  • GiST
  • ?? lt, lt, , gt, gt, _at_gt, lt_at_, _at_, , ?

21
??????????
  • ?????? ?? ????????
  • ???????? ???????
  • CMS ???????
  • ? ??.
Write a Comment
User Comments (0)
About PowerShow.com