[Qgis-developer] Qgis donload entire postgis data table (with geom?) opening attribute table

Pietro Rossin pierigis at gmail.com
Tue Sep 13 05:19:02 PDT 2016


Hello
with Qgis and Postgis layers I noticed a strange behaviour

Qgis 2.16.2 on windows 7 x64, Postgis 2.1 on Postgres 9.4.x debian server

I created a vector multipolygon table:
**************************************
CREATE TABLE myschema.mytable
(  id serial NOT NULL,
  geom geometry(MultiPolygon,3045),
  name character varying(254),
  code character varying(254),
  CONSTRAINT mytable_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);

CREATE INDEX sidx_mytable_geom
  ON myschema.mytable
  USING gist
  (geom);
************************************

This table contains 217 feature (regional districts) with names and codes.
Disk space (https://wiki.postgresql.org/wiki/Disk_Usage) is:

************************************
oid	17848
table_schema = myschema
table_name = mytable
row_estimate = 217
total_bytes = 22142976
index_bytes = 24576
toast_bytes = 22077440
table_bytes = 40960
total = 21 MB
index = 24 kB
toast = 21 MB
table = 40 kB
************************************

When I load this layer in TOC Qgis downloads 1.3MB (server side
simplyfication enabled in display options).

Then If I right click on layer and select open attribute table Qgis
downloads 22MB.

Then on the table if I click on the top left corner to select all records
Qgis downloads other 1.3MB.

At this point If I copy (ctrl+C) all records Qgis downloads other 22MB.

Pasting into excel spreadsheet result in a huge amount of data, because
there is a WKT column with geometry in WKT format.

Executing this query

******************
SELECT id, name, code FROM mytable;
******************

in Qgis generates 9.0KB download traffic
PGAdminIII generates 9.9KB with the same query.

In PGadminIII this query
******************
SELECT id, ST_AsEWKt(geom), name, code  FROM myschema.mytable;
******************
or this one
******************
SELECT id, ST_Astext(geom), name, code  FROM myschema.mytable;
******************
downloads 45.8MB

It seems that Qgis downloads some kind of geometry definition opening
attribute table, it doesn't seem a wkt (22MB vs 45.8MB)

Now,
is this normal??

If yes, what is the usefulness in downloading all postgis/postgres table
when selecting "open attribute table"?
Couldn't be more useful to download only real "attribute values", 9KB
instead of 22MB??

I know in previous Qgis version there was the possibility to choose if we
wanted the WKT column together with attribute table for copy/paste from/to
other applicatios, in Qgis 2.16 I kan't find it..

Thanks
Pietro



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Qgis-donload-entire-postgis-data-table-with-geom-opening-attribute-table-tp5285532.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list