[GRASS-dev] [GRASS GIS] #2656: GRASS freezes for 5-10 mins before eventually showing attribute table

#2656: GRASS freezes for 5-10 mins before eventually showing attribute table
-----------------------------------------+----------------------------------
Reporter: richardc | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.1
Component: Vector | Version: svn-releasebranch70
Keywords: attribute table, postgresql | Platform: Linux
      Cpu: x86-64 |
-----------------------------------------+----------------------------------
On attempting to display a vector attribute table in the Layer Manager,
GRASS entirely freezes for about 5-10 mins, displaying the message -
Please wait loading attribute data... - and then the attribute table is
eventually displayed.

I'm not sure if related to postgresql which I'm using instead of sqlite;
sqlite tables are shown without trouble.

I'm not sure if a bug, or how to resolve?

Thanks,
Richard

{{{

Database:
postgresql-9.3
Database size: 1542 MB / 53580 tables

The attribute table is small: 1 row/10 columns

db.test gives the following, which appears functional:
db.test test=test1
Using DB driver: pg
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
RESULT: OK
EXECUTE: OK
RESULT: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
ERROR: RESULT: ******** ERROR ********
2d1
< 3|0|_\\'_|
3a3
> 3|0|_\'_|
CREATE TABLE grass_test1 (i1 INTEGER, d1 DOUBLE PRECISION, c1 VARCHAR(20))
INSERT INTO grass_test1 VALUES ( 1, 123.456, 'abcd' )
INSERT INTO grass_test1 VALUES ( 2, null, 'xxx' )
SELECT * FROM grass_test1
SELECT c1 FROM grass_test1 WHERE d1 < 500 / 2 AND i1 <> 2 AND c1 LIKE
'%bc%'
INSERT INTO grass_test1 VALUES ( 3, 0.0, '_\''_' )
ALTER TABLE grass_test1 ADD COLUMN i2 INTEGER
UPDATE grass_test1 SET d1 = 18.6, i2 = 987 WHERE i1 = 2
SELECT * FROM grass_test1
DROP TABLE grass_test1
EXECUTE: OK
(Sat Apr 18 21:17:56 2015) Command finished (0 sec)

My system:
GRASS version: 7.0.1svn
GRASS SVN Revision: 65041
Build Date: 2015-04-10
Build Platform: x86_64-unknown-linux-gnu
GDAL/OGR: 1.11.2
PROJ.4: 4.9.0
GEOS: 3.4.2
SQLite: 3.8.2
Python: 2.7.6
wxPython: 2.8.12.1
Platform: Linux-3.13.0-37-generic-x86_64-with-LinuxMint-17.1-rebecca

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2656&gt;
GRASS GIS <http://grass.osgeo.org>

#2656: GRASS freezes for 5-10 mins before eventually showing attribute table
-----------------------------------------+----------------------------------
Reporter: richardc | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.1
Component: Vector | Version: svn-releasebranch70
Keywords: attribute table, postgresql | Platform: Linux
      Cpu: x86-64 |
-----------------------------------------+----------------------------------

Comment(by richardc):

My comment about the sqlite db is wrong - I have the same issue in trying
to display a sqlite vector attribute table with the entire GRASS
application freezing.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2656#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2656: GRASS freezes for 5-10 mins before eventually showing attribute table
-----------------------------------------+----------------------------------
Reporter: richardc | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.1
Component: Vector | Version: svn-releasebranch70
Keywords: attribute table, postgresql | Platform: Linux
      Cpu: x86-64 |
-----------------------------------------+----------------------------------

Comment(by richardc):

Replying to [comment:1 richardc]:
> My comment about the sqlite db is wrong - I have the same issue in
trying to display a sqlite vector attribute table with the entire GRASS
application freezing.

However, attribute data can be displayed within 1 second with v.db.select
(with postgresql db):

{{{

v.db.select map=bnd_cahpa_f1apr_05216_nc_remapped_nc_1@cahpa05216psql
cat|to_bas|sub_bas|maj_bas|sub_name|maj_name|sub_area|maj_area|legend|cap_average
1|-999|21014|5021|pran|Peninsula
Malaysia|3732|311477|21|2.07500273518235e-05
(Sun Apr 19 13:10:47 2015) Command finished (0 sec)

}}}

Issue is related to right clicking on layer name in Layer Manager and
selecting 'Show attribute data'

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2656#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2656: GRASS freezes for 5-10 mins before eventually showing attribute table
-----------------------------------------+----------------------------------
Reporter: richardc | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.1
Component: wxGUI | Version: svn-releasebranch70
Keywords: attribute table, postgresql | Platform: Linux
      Cpu: x86-64 |
-----------------------------------------+----------------------------------
Changes (by richardc):

  * component: Vector => wxGUI

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2656#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2656: GRASS freezes for 5-10 mins before eventually showing attribute table
-----------------------+-----------------------------------------
  Reporter: richardc | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.1
Component: wxGUI | Version: svn-releasebranch70
Resolution: | Keywords: attribute table, postgresql
       CPU: x86-64 | Platform: Linux
-----------------------+-----------------------------------------

Comment (by richardc):

Hi,

I was wondering if anyone might have any suggestions on how to resolve
this issue.

For instance, in addition to GRASS freezing on trying to show the
attribute table, the same is observed with db.describe or db.columns when
selected from the Layer Manager GUI. I have to restart GRASS each time if
I inadvertently select the these commands.

e.g.,
Database > Database information > Describe table [db.describe]

I am however, able to list database tables:

db.tables -p
public.bnd_cahpa_f1apr_05216_nc_remapped_nc_1
public.bnd_cahpa_f1apr_05216_nc_remapped_nc_10
public.bnd_cahpa_f1apr_05216_nc_remapped_nc_11
public.bnd_cahpa_f1apr_05216_nc_remapped_nc_12

I notice one error in the following:

{{{

(Mon May 11 11:49:23 2015)
db.test --verbose test=test1
Using DB driver: pg
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
RESULT: OK
EXECUTE: OK
RESULT: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
EXECUTE: OK
ERROR: RESULT: ******** ERROR ********
EXECUTE: OK
2d1
< 3|0|_\\'_|
3a3
> 3|0|_\'_|
CREATE TABLE grass_test1 (i1 INTEGER, d1 DOUBLE PRECISION, c1 VARCHAR(20))
INSERT INTO grass_test1 VALUES ( 1, 123.456, 'abcd' )
INSERT INTO grass_test1 VALUES ( 2, null, 'xxx' )
SELECT * FROM grass_test1
SELECT c1 FROM grass_test1 WHERE d1 < 500 / 2 AND i1 <> 2 AND c1 LIKE
'%bc%'
INSERT INTO grass_test1 VALUES ( 3, 0.0, '_\''_' )
ALTER TABLE grass_test1 ADD COLUMN i2 INTEGER
UPDATE grass_test1 SET d1 = 18.6, i2 = 987 WHERE i1 = 2
SELECT * FROM grass_test1
DROP TABLE grass_test1
(Mon May 11 11:49:23 20

}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2656#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>