hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lili Ma (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HAWQ-1428) Table name pg_aoseg_$relfilenode does not change after running truncate command
Date Mon, 10 Apr 2017 02:43:41 GMT
Lili Ma created HAWQ-1428:
-----------------------------

             Summary: Table name pg_aoseg_$relfilenode does not change after running truncate
command
                 Key: HAWQ-1428
                 URL: https://issues.apache.org/jira/browse/HAWQ-1428
             Project: Apache HAWQ
          Issue Type: Bug
          Components: Core
            Reporter: Lili Ma
            Assignee: Ed Espino


The table pg_aoseg.pg_aoseg(paqseg)_$relfilenode describes the information of file stored
on HDFS for AO table and Parquet table. To make users easily find this catalog table, the
suffix should equal the relfilenode for this table.

After running truncate command, the relfilenode field for this table changed, but pg_aoseg_$
table name was not changed. 

Reproduce Steps:
{code}
postgres=# create table a(a int);
CREATE TABLE
postgres=# insert into a values(51);
INSERT 0 1
postgres=# select oid, * from pg_class where relname='a';
  oid  | relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace
| relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrelid | relaosegidxid | relhasindex
| relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys
| relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relfrozenxid | relacl
|    reloptions
-------+---------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------------+--------+-------------------
 61269 | a       |         2200 |   61270 |       10 |     0 |       61269 |             0
|        1 |         1 |             0 |             0 |             0 |             0 | f
          | f           | r       | a          |        1 |         0 |           0 |    
   0 |        0 |       0 | f          | f          | f           | f              |     
  16214 |        | {appendonly=true}
(1 row)

postgres=# select oid, * from pg_class, pg_appendonly where pg_appendonly.relid=61269 and
pg_appendonly.segrelid=pg_class.oid;
  oid  |    relname     | relnamespace | reltype | relowner | relam | relfilenode | reltablespace
| relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrelid | relaosegidxid | relhasindex
| relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys
| relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relfrozenxid | relacl
| reloptions | relid | blocksize | safefswritesize | compresslevel | majorversion | minorversion
| checksum | compresstype | columnstore | segrelid | segidxid | blkdirrelid | blkdiridxid
| version | pagesize | splitsize
-------+----------------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------------+--------+------------+-------+-----------+-----------------+---------------+--------------+--------------+----------+--------------+-------------+----------+----------+-------------+-------------+---------+----------+-----------
 61271 | pg_aoseg_61269 |         6104 |   61272 |       10 |     0 |       61271 |      
      0 |        0 |         0 |             0 |             0 |             0 |         
   0 | t           | f           | o       | h          |        5 |         0 |         
 0 |        0 |        0 |       0 | f          | t          | f           | f           
  |        16214 |        |            | 61269 |     32768 |               0 |           
 0 |            2 |            0 | f        |              | f           |    61271 |    61273
|           0 |           0 |       2 |        0 |  67108864
(1 row)

postgres=# truncate a;
TRUNCATE TABLE
postgres=# select oid, * from pg_class where relname='a';                                
       oid  | relname | relnamespace | reltype | relowner | relam | relfilenode | reltablespace
| relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrelid | relaosegidxid | relhasindex
| relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys
| relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relfrozenxid | relacl
|    reloptions
-------+---------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------------+--------+-------------------
 61269 | a       |         2200 |   61270 |       10 |     0 |       61274 |             0
|        0 |         0 |             0 |             0 |             0 |             0 | f
          | f           | r       | a          |        1 |         0 |           0 |    
   0 |        0 |       0 | f          | f          | f           | f              |     
  16214 |        | {appendonly=true}
(1 row)

postgres=# select oid, * from pg_class, pg_appendonly where pg_appendonly.relid=61269 and
pg_appendonly.segrelid=pg_class.oid;
  oid  |    relname     | relnamespace | reltype | relowner | relam | relfilenode | reltablespace
| relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrelid | relaosegidxid | relhasindex
| relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys
| relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relfrozenxid | relacl
| reloptions | relid | blocksize | safefswritesize | compresslevel | majorversion | minorversion
| checksum | compresstype | columnstore | segrelid | segidxid | blkdirrelid | blkdiridxid
| version | pagesize | splitsize
-------+----------------+--------------+---------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+---------------+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-------------+----------------+--------------+--------+------------+-------+-----------+-----------------+---------------+--------------+--------------+----------+--------------+-------------+----------+----------+-------------+-------------+---------+----------+-----------
 61271 | pg_aoseg_61269 |         6104 |   61272 |       10 |     0 |       61275 |      
      0 |        0 |         0 |             0 |             0 |             0 |         
   0 | t           | f           | o       | h          |        5 |         0 |         
 0 |        0 |        0 |       0 | f          | t          | f           | f           
  |        16214 |        |            | 61269 |     32768 |               0 |           
 0 |            2 |            0 | f        |              | f           |    61271 |    61273
|           0 |           0 |       2 |        0 |  67108864
(1 row)
{code}

Since relfilenode has changed to 61274, we should change the table name to "pg_aoseg_61274"
instead of keeping it as "pg_aoseg_61269" 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message