Message posté par : Nicolas Ribot
----------------------------------------
Un test rapidos sur une table de ~2000 polygones donne ca:
-----------------
Code :
select postgis_full_version();
-- POSTGIS="3.4.2 c19ce56" [EXTENSION] PGSQL="160"
GEOS="3.13.0-CAPI-1.19.0" (compiled against GEOS 3.12.2) SFCGAL="SFCGAL
1.5.2, CGAL 5.6.1, BOOST 1.86.0" PROJ="9.5.0 NETWORK_ENABLED=OFF
URL_ENDPOINT=https://cdn.proj.org
USER_WRITABLE_DIRECTORY=/Users/nicolas.ribot/Library/Application Support/proj
DATABASE_PATH=/opt/homebrew/Cellar/proj/9.5.0/share/proj/proj.db" GDAL="GDAL
3.9.2, released 2024/08/13" LIBXML="2.9.13" LIBJSON="0.18"
RASTER
vacuum full nuts_europe;
-- Table "public.nuts_europe"
--
+------------+-----------------------------+-----------+----------+-----------------------------------------+----------+-------------+--------------+-------------+
-- | Column | Type | Collation | Nullable |
Default | Storage | Compression | Stats target | Description |
--
+------------+-----------------------------+-----------+----------+-----------------------------------------+----------+-------------+--------------+-------------+
-- | id | integer | | not null |
nextval('nuts_europe_id_seq'::regclass) | plain | | |
|
-- | geom | geometry(MultiPolygon,4326) | | |
| main | | | |
-- | nuts_id | character varying(5) | | |
| extended | | | |
-- | levl_code | integer | | |
| plain | | | |
-- | cntr_code | character varying(2) | | |
| extended | | | |
-- | name_latn | character varying(70) | | |
| extended | | | |
-- | nuts_name | character varying(106) | | |
| extended | | | |
-- | mount_type | integer | | |
| plain | | | |
-- | urbn_type | integer | | |
| plain | | | |
-- | coast_type | integer | | |
| plain | | | |
-- | fid | character varying(5) | | |
| extended | | | |
--
+------------+-----------------------------+-----------+----------+-----------------------------------------+----------+-------------+--------------+-------------+
-- Indexes:
-- "nuts_europe_pkey" PRIMARY KEY, btree (id)
-- Access method: heap
select pg_size_pretty(pg_total_relation_size('nuts_europe')) as tot,
pg_size_pretty(pg_relation_size('nuts_europe')) as tab,
pg_size_pretty(pg_indexes_size('nuts_europe')) as idx;
-- +-----+-------+-----+
-- |tot |tab |idx |
-- +-----+-------+-----+
-- |30 MB|6056 kB|64 kB|
-- +-----+-------+-----+
create table t1 as
select n.id,
st_snaptogrid(n.geom, 0.01) as geom,
n.nuts_id,
n.levl_code,
n.cntr_code,
n.name_latn,
n.nuts_name,
n.mount_type,
n.urbn_type,
n.coast_type,
n.fid
from nuts_europe n;
alter table t1 add primary key (id);
vacuum analyze t1;
select pg_size_pretty(pg_total_relation_size('t1')) as tot,
pg_size_pretty(pg_relation_size('t1')) as tab,
pg_size_pretty(pg_indexes_size('t1')) as idx;
-- +-------+-------+-----+
-- |tot |tab |idx |
-- +-------+-------+-----+
-- |7224 kB|4736 kB|64 kB|
-- +-------+-------+-----+
create table t2 as
select n.id,
st_reduceprecision(n.geom, 0.01) as geom,
n.nuts_id,
n.levl_code,
n.cntr_code,
n.name_latn,
n.nuts_name,
n.mount_type,
n.urbn_type,
n.coast_type,
n.fid
from nuts_europe n;
alter table t2 add primary key (id);
vacuum analyze t2;
select pg_size_pretty(pg_total_relation_size('t2')) as tot,
pg_size_pretty(pg_relation_size('t2')) as tab,
pg_size_pretty(pg_indexes_size('t2')) as idx;
-- +-------+-------+-----+
-- |tot |tab |idx |
-- +-------+-------+-----+
-- |6792 kB|4608 kB|64 kB|
-- +-------+-------+-----+
create table t3 as
select n.id,
st_quantizecoordinates(n.geom, 0) as geom,
n.nuts_id,
n.levl_code,
n.cntr_code,
n.name_latn,
n.nuts_name,
n.mount_type,
n.urbn_type,
n.coast_type,
n.fid
from nuts_europe n;
alter table t3 add primary key (id);
vacuum analyze t3;
select pg_size_pretty(pg_total_relation_size('t3')) as tot,
pg_size_pretty(pg_relation_size('t3')) as tab,
pg_size_pretty(pg_indexes_size('t3')) as idx;
-- +-------+-------+-----+
-- |tot |tab |idx |
-- +-------+-------+-----+
-- |1624 kB|1216 kB|64 kB|
-- +-------+-------+-----+
-----------------
Nicolas
----------------------------------------
Le message est situé
https://georezo.net/forum/viewtopic.php?pid=369912#p369912
Pour y répondre : geobd(a)ml.georezo.net ou reply de votre messagerie
Pour vous désabonner connectez-vous sur le forum puis Profil / Abonnement
--
Association GeoRezo - le portail géomatique
https://georezo.net