Opened 11 years ago

Closed 5 years ago

#246 closed enhancement (fixed)

Getting information about arrays

Reported by: Dimitar Misev Owned by: Dimitar Misev
Priority: minor Milestone: Future
Component: qlparser Version: 8.3
Keywords: Cc: Peter Baumann
Complexity: Medium

Description (last modified by Dimitar Misev)

A function which returns information about an array in the database would be very useful. The information we can extract right now is limited to:

  • array dimensionality and extents
  • array type by specifying --type to rasql

Further info that would be highly useful:

  • tiling scheme and configuration, number of tiles
  • the index used
  • storage format
  • size in bytes of an array; often arrays are only partially materialized, so this would be useful information.

This could be implemented as an info function, which similarly to RAS_COLLECTIONNAMES returns a char array with the above (and possibly further) information.

Change History (17)

comment:1 by Dimitar Misev, 11 years ago

Description: modified (diff)

comment:2 by Dimitar Misev, 11 years ago

Description: modified (diff)

comment:3 by Dimitar Misev, 11 years ago

Description: modified (diff)

comment:4 by Dimitar Misev, 11 years ago

Proposed solution:

$ rasql -q 'select info(c) from mr as c' --out string
rasql: rasdaman query tool v1.0, rasdaman v8.3.1-g1ecc2e1 -- generated on 07.12.2012 16:06:36.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 3 element(s):
  Result object 1: Oid: 342529; Tiles: 1; Object size: 54016B; Tiling scheme: no tiling; Tile size: 2097152; Tile configuration: [0:511,0:511]; Index type: rpt_index; Index size: 0; PCT max: 4096B; PCT min: 2048B; Base type: marray <char, 2>
  Result object 2: Oid: 343041; Tiles: 1; Object size: 54016B; Tiling scheme: no tiling; Tile size: 2097152; Tile configuration: [0:511,0:511]; Index type: rpt_index; Index size: 0; PCT max: 4096B; PCT min: 2048B; Base type: marray <char, 2>
  Result object 3: Oid: 343553; Tiles: 1; Object size: 54016B; Tiling scheme: no tiling; Tile size: 2097152; Tile configuration: [0:511,0:511]; Index type: rpt_index; Index size: 0; PCT max: 4096B; PCT min: 2048B; Base type: marray <char, 2>
rasql done.

comment:5 by Dimitar Misev, 11 years ago

Alternative JSON output encoding:

$ rasql -q 'select info(c) from mr as c' --out string
rasql: rasdaman query tool v1.0, rasdaman v8.3.1-g8897c51 -- generated on 07.12.2012 16:06:36.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 4 element(s):
  Result object 1: {
 "oid": "150529",
 "baseType": "marray <char>",
 "tileNo": "1",
 "totalSize": "54016B",
 "tiling": {
	"tilingScheme": "no_tiling",
	"tileSize": "2097152",
	"tileConfiguration": "[0:511,0:511]"
 },
 "index": {
	"type": "rpt_index",
	"indexSize": "0",
	"PCTmax": "4096B",
	"PCTmin": "2048B"
 }
}

comment:6 by Peter Baumann, 11 years ago

Milestone: 8.4

comment:7 by Dimitar Misev, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in changeset:ce08b30e549711685a044384f867831352c51276

Example use:

   $ rasql -q 'select dbinfo(eobs) from eobs' --out string
   rasql: rasdaman query tool v1.0, rasdaman osgeolive.5-24-g3ee4345 -- generated on 12.02.2013 09:39:11.
   opening database RASBASE at localhost:7001...ok
   Executing retrieval query...ok
   Query result collection has 1 element(s):
      Result object 1: {
     "oid": "111617",
     "baseType": "marray <short, 5>",
     "tileNo": "6344",
     "totalSize": "1063437888",
     "tiling": {
        "tilingScheme": "aligned",
        "tileSize": "4194304",
        "tileConfiguration": "[0:1023,0:1023]"
     },
     "index": {
        "type": "rpt_index",
        "PCTmax": "4096",
        "PCTmin": "2048"
     }
   }
   rasql done. 

comment:8 by Peter Baumann, 11 years ago

Resolution: fixed
Status: closedreopened

Let us reconsider syntax to make it more database style. Generalizing the idea, we might think of cases like:

DESCRIBE COLLECTION collName
DESCRIBE ARRAY oid
DESCRIBE TYPE typeName

comment:9 by Peter Baumann, 11 years ago

Milestone: 8.49.0
Priority: majorminor

comment:10 by Peter Baumann, 11 years ago

Component: applicationsqlparser

comment:11 by Dirk Daems, 11 years ago

Complexity: Medium

The output of the tile configuration doesn't seem to be correct in version 8.4 rc2:

[rasdaman@epod8 Biopar]$ rasql -q "select dbinfo(c) from Biopar_Africa_LAI as c" --out string
rasql: rasdaman query tool v1.0, rasdaman v8.4.0rc.2-3-g27a914b -- generated on 20.03.2013 11:53:11.
opening database RASBASE at localhost:7001...ok
Executing retrieval query...ok
Query result collection has 1 element(s):
  Result object 1: {
 "oid": "3585",
 "baseType": "marray <char, 3>",
 "tileNo": "2592",
 "totalSize": "2890782756",
 "tiling": {
	"tilingScheme": "aligned",
	"tileSize": "4194304",
	"tileConfiguration": "[0:1023,0:1023]"
 },
 "index": {
	"type": "rpt_index",
	"PCTmax": "4096",
	"PCTmin": "2048"
 }
}
rasql done.

In this case, it should be:

...
"tileConfiguration": "[0:3,0:1023,0:1023]"
...

Which would also match the tile size: 4*1021*1024 = 4194304.

comment:12 by Dimitar Misev, 11 years ago

Did you specify the tiling yourself when initializing the object?

The above tiling conf matches better the totalSize / tileNo

comment:13 by Dirk Daems, 11 years ago

We used initmdd to initialize the collection and to specify the tiling strategy, but the tile configuration shown by dbinfo() doesn't match the one used with initmdd.

comment:14 by Dimitar Misev, 11 years ago

initmdd may not be completely compatible with rasql. You should switch to using rasql for the initialization too (tiling has been fixed in the meantime), see wiki:Tiling

comment:15 by Dimitar Misev, 10 years ago

Milestone: 9.0.x9.1

comment:16 by Dimitar Misev, 9 years ago

Milestone: 9.1Future

comment:17 by Vlad Merticariu, 5 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.