Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
5 and Beyond
BRUCE MOMJIAN
http://momjian.us/presentations
1 / 36
4.
5.
6.
7.
8.
9.
ROLLUP
1. INSERT ON CONFLICT
GROUP BY
and recomputation
UNION ALL
combinations in a
NULL
Employee Table
GROUP BY Example
SELECT office, COUNT(*)
FROM employee
GROUP BY office;
office | count
--------+------SFO
|
2
PHL
|
4
SELECT department, COUNT(*)
FROM employee
GROUP BY department;
department | count
------------+------Marketing |
2
Shipping
|
1
Sales
|
3
Major Features: Postgres 9.5 and Beyond 14 / 36
ROLLUP Example
SELECT office, department, COUNT(*)
FROM employee
GROUP BY ROLLUP (office, department)
ORDER BY office, department;
office | department | count
--------+------------+------PHL
| Marketing |
2
PHL
| Sales
|
1
PHL
| Shipping
|
1
PHL
|
|
4
SFO
| Sales
|
2
SFO
|
|
2
|
|
6
CUBE Example
SELECT office, department, COUNT(*)
FROM employee
GROUP BY CUBE (office, department)
ORDER BY office, department;
office | department | count
--------+------------+------PHL
| Marketing |
2
PHL
| Sales
|
1
PHL
| Shipping
|
1
PHL
|
|
4
SFO
| Sales
|
2
SFO
|
|
2
| Marketing |
2
| Sales
|
3
| Shipping
|
1
|
|
6
Major Features: Postgres 9.5 and Beyond 18 / 36
POLICY,
and ALTER
TABLE
Allow CREATE
sorting
INDEX, REINDEX,
Reduce the number of page locks and pins during index scans
Begin 1
1111
0000
1
0000
1111
0000
1111
1111
0000
1
0000
1111
0000
1111
WriteAhead Log
111
000
1
000
111
000
111
1111
0000
0000
1111
000
111
1
2 000
2
0000
1111
0000
0000 1111
1111
0000111
1111
000
111
111
000
0000
1111
11111
2
000
111
0000
000
111
0000
1111
End 1
1111111
0000
000
0000
1111
000
111
2 111
2
0000
1111
0000000
1111
000
111
1111
0000
0000
1111
2
0000
1111
0000
1111
Rotate
1111
0000
000
111
0000
1111
000
111
2 111
2
0000
1111
0000000
1111
000
111
1111
0000
0000
1111
2
0000
1111
0000
1111
Major Features: Postgres 9.5 and Beyond 28 / 36
Allow removal of
operator
JSONB
Allow merging of
(|| operator)
JSONB
Allow
CHECK
http://boundlessgeo.com/2011/09/indexed-nearest-neighbour-search-in-postgis/
http://shisaa.jp/postset/postgis-postgresqls-spatial-partner-part-3.html
Major Features: Postgres 9.5 and Beyond 32 / 36
SELECT st_distance(geom,
SRID=3005;POINT(1011102 450541)) AS distance,
parcel_id, address
FROM parcels
ORDER BY geom <-> SRID=3005;POINT(1011102 450541)
LIMIT 10
http://www.postgresonline.com/journal/archives/350-PostGIS-2.2-leveraging-power-of-PostgreSQL-9.5.html
http://postgis.net/docs/manual-dev/geometry_distance_knn.html
Parallelism
sequential scan
joins
Parallelism
aggregate computation
sorting
Faster sorting
Multi-variate statistics
pg_logical
Freeze avoidance using a freeze map
Snapshot age control
Auditing
High concurrency performance
Checkpoint performance improvements
Relation extension lock
Snapshot caching
Partitioning syntax
Sharding
Conclusion
http://momjian.us/presentations
https://www.flickr.com/photos/thevlue/
Major Features: Postgres 9.5 and Beyond 36 / 36