当前位置:   article > 正文

详解GaussDB(DWS)中3个防过载检查项

详解GaussDB(DWS)中3个防过载检查项

本文分享自华为云社区《【防过载检查项】》,作者: 譡里个檔。

1. GUC参数检查

目的:针对不同版本建议设定不同的参数值,当前先检查出来,后续diagnosis会给出建议值

  1. SELECT
  2. split_part((substring(version() from '\((.*)\)')), ' ', 2) AS version,
  3. (EXISTS (SELECT 1 FROM (SELECT count(DISTINCT node_name) AS dn_cnt
  4. FROM pgxc_node WHERE node_type = 'D' AND node_host <> 'localhost' GROUP BY node_host) WHERE dn_cnt <> 1)
  5. ) AS sdn_per_node,
  6. node_name, name AS guc_name,
  7. CASE WHEN unit = 'ms' THEN setting::bigint/1000 || ' s'
  8. WHEN unit = 's' THEN setting || ' s'
  9. WHEN unit = 'KB' THEN pg_size_pretty(setting*1024)
  10. WHEN unit = '8KB' THEN pg_size_pretty(setting*1024*8)
  11. ELSE setting
  12. END AS setting, unit,
  13. CASE WHEN name = 'default_distribution_mode' THEN
  14. CASE WHEN setting <> 'roundrobin' THEN 'roundrobin' END
  15. WHEN name = 'autovacuum' THEN
  16. CASE WHEN setting <> 'on' THEN 'on' END
  17. WHEN name = 'autovacuum_max_workers' THEN
  18. CASE WHEN setting::int > 6 THEN '6' END
  19. WHEN name = 'autovacuum_max_workers' THEN
  20. CASE WHEN setting::int > 3 THEN '3' END
  21. WHEN name = 'session_timeout' THEN
  22. CASE WHEN setting::int > 600 OR setting::int = 0 THEN '<= 10min' END
  23. WHEN name = 'statement_timeout' THEN
  24. CASE WHEN setting::int > 24* 60 * 1000 OR setting::int = 0 THEN '<= 24h' END
  25. WHEN name = 'sql_use_spacelimit' THEN
  26. CASE WHEN setting::int > 300*1024*1024 OR setting IN ('0', '-1') THEN '<= 300GB' END
  27. WHEN name = 'temp_file_limit' THEN
  28. CASE WHEN setting::int > 100*1024*1024 OR setting IN ('0', '-1') THEN '<= 100GB' END
  29. WHEN name = 'udf_memory_limit' THEN
  30. CASE WHEN setting::int > 1*1024*1024 THEN '<= 1GB' END
  31. WHEN name = 'query_dop' THEN
  32. CASE WHEN setting::int = 0 THEN ' -4' END
  33. WHEN name = 'max_streams_per_query' THEN
  34. CASE WHEN setting::int = -1 THEN '50' END
  35. WHEN name = 'max_connections' THEN
  36. CASE WHEN node_name = 'dn_6001_6002' AND setting::int < 5000 THEN '>=5000' END
  37. ELSE ''
  38. END AS diagnosis
  39. FROM pgxc_parallel_query('all', 'SELECT
  40. pgxc_node_str() AS node_name, name, setting, unit
  41. FROM pg_settings
  42. WHERE pgxc_node_str() IN (''cn_5001'',''dn_6001_6002'')
  43. AND name in (''max_streams_per_query'',''query_dop''
  44. ,''sql_use_spacelimit'',''temp_file_limit'',''default_distribution_mode'',
  45. ''autovacuum_mode'',''autovacuum'',''autovacuum_max_workers_hstore'',''autovacuum_max_workers'',
  46. ''session_timeout'',''statement_timeout'',''ddl_lock_timeout'',''idle_in_transaction_timeout'',
  47. ''max_connections'',''min_pool_size'',''max_pool_size'',
  48. ''max_stream_pool'',''max_active_statements'',''max_prepared_transactions'',
  49. ''cstore_buffers'',''shared_buffers'', ''max_process_memory'', ''udf_memory_limit'',
  50. ''max_process_memory_balanced'', ''bbox_dump_count'', ''enable_bbox_dump'')')
  51. AS (node_name name, name text, setting text, unit text)
  52. ORDER BY node_name, name;

2. 大表检查

目的:识别大表,建议客户整改,避免磁盘过载

8.1.3版本使用如下SQL

  1. SELECT
  2. CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
  3. WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
  4. WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
  5. WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
  6. ELSE 'normal large table'
  7. END AS diagnostic,
  8. t1.schemaname, -- 表的schema
  9. t1.tablename, -- 表名
  10. a.rolname AS tableowner,
  11. x.pgroup AS nodegroup,
  12. CASE x.pclocatortype WHEN 'H' THEN 'Hash'
  13. WHEN 'N' THEN 'Round Robin'
  14. WHEN 'R' THEN 'Replicate'
  15. END AS locatortype,
  16. CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
  17. CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
  18. WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
  19. END AS orientation,
  20. t1.dnnum, -- 表的node group的DN数
  21. t1.totalsize AS "totalsize(MB)", -- 表的size ,单位MB
  22. t1.avgsize AS "avgsize(MB)", -- 平均每个DN上数据量,单位MB
  23. t1.skewsize AS "skewsize(MB)", -- 不同DN上数据size的最大差值,单位MB
  24. t1.skewdn, -- 数据量最大的DN
  25. t1.maxratio, -- 数据量最大DN的size/平均size
  26. t1.minratio, -- 数据量最小DN的size/平均size
  27. t1.skewratio -- 不同DN上数据size的最大差值/平均size
  28. FROM ( -- 预处理,识别倾斜表
  29. SELECT
  30. schemaname,
  31. tablename,
  32. skewdn,
  33. dnnum,
  34. totalsize,
  35. avgsize,
  36. skewsize,
  37. (maxsize/avgsize)::numeric(20,2) AS maxratio,
  38. (minsize/avgsize)::numeric(20,2) AS minratio,
  39. (skewsize/avgsize)::numeric(20,2) AS skewratio
  40. FROM (
  41. SELECT
  42. schemaname,tablename,skewdn,count(1) AS dnnum,sum(dnsize) AS totalsize,
  43. avg(dnsize) AS avgsize,max(dnsize) AS maxsize,min(dnsize) AS minsize, (max(dnsize) - min(dnsize)) AS skewsize
  44. FROM ( --对每个表的数据按照DN数据量大小排序,以及获取倾斜的dn
  45. SELECT
  46. schemaname,
  47. tablename,
  48. nodename,
  49. (dnsize/1024/1024)::bigint AS dnsize, -- 单位换算为MB
  50. first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn -- --数据量最大的DN
  51. FROM ( -- 获取大于10GB的表
  52. SELECT
  53. schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
  54. FROM (
  55. SELECT
  56. schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
  57. FROM gs_table_distribution()
  58. WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
  59. AND relkind = 'r'
  60. GROUP BY schemaname, tablename
  61. HAVING sum(dnsize) > 50.0 * 1024 * 1024 * 1024 -- 总大小大于100GB
  62. )
  63. )
  64. )
  65. GROUP BY schemaname,tablename, skewdn
  66. )
  67. ) t1
  68. INNER JOIN pg_class c ON c.relname = t1.tablename
  69. LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
  70. LEFT JOIN pg_authid a ON a.oid = c.relowner
  71. LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
  72. WHERE c.reloptions::text NOT LIKE '%internal_mask%'
  73. ORDER BY totalsize DESC, diagnostic, skewsize DESC
  74. ;

8.2.1和8.2.0版本使用如下

  1. -- 大表诊断
  2. SELECT
  3. CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
  4. WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
  5. WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
  6. WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
  7. WHEN (reloptions::text LIKE '%orientation=column%') THEN
  8. CASE WHEN (SELECT total_cu_count > 0 AND (zero_size_cu_count + small_cu_count)/total_cu_count > 0.5 FROM get_col_cu_info(t1.schemaname, t1.tablename)) THEN 'small cu table'
  9. ELSE 'normal large table'
  10. END
  11. ELSE 'normal large table'
  12. END AS diagnostic,
  13. t1.schemaname, -- 表的schema
  14. t1.tablename, -- 表名
  15. a.rolname AS tableowner,
  16. x.pgroup AS nodegroup,
  17. CASE x.pclocatortype WHEN 'H' THEN 'Hash'
  18. WHEN 'N' THEN 'Round Robin'
  19. WHEN 'R' THEN 'Replicate'
  20. END AS locatortype,
  21. CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
  22. CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
  23. WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
  24. END AS orientation,
  25. t1.dnnum, -- 表的node group的DN数
  26. t1.totalsize AS "totalsize(MB)", -- 表的size ,单位MB
  27. t1.avgsize AS "avgsize(MB)", -- 平均每个DN上数据量,单位MB
  28. t1.skewsize AS "skewsize(MB)", -- 不同DN上数据size的最大差值,单位MB
  29. t1.skewdn, -- 数据量最大的DN
  30. t1.maxratio, -- 数据量最大DN的size/平均size
  31. t1.minratio, -- 数据量最小DN的size/平均size
  32. t1.skewratio -- 不同DN上数据size的最大差值/平均size
  33. FROM ( -- 预处理,识别倾斜表
  34. SELECT
  35. schemaname,
  36. tablename,
  37. skewdn,
  38. dnnum,
  39. totalsize,
  40. avgsize,
  41. skewsize,
  42. (maxsize/avgsize)::numeric(20,2) AS maxratio,
  43. (minsize/avgsize)::numeric(20,2) AS minratio,
  44. (skewsize/avgsize)::numeric(20,2) AS skewratio
  45. FROM (
  46. SELECT
  47. schemaname,
  48. tablename,
  49. skewdn,
  50. count(1) AS dnnum,
  51. sum(dnsize) AS totalsize,
  52. avg(dnsize) AS avgsize,
  53. max(dnsize) AS maxsize,
  54. min(dnsize) AS minsize,
  55. (max(dnsize) - min(dnsize)) AS skewsize
  56. FROM ( --对每个表的数据按照DN数据量大小排序,以及获取倾斜的dn
  57. SELECT
  58. schemaname,
  59. tablename,
  60. nodename,
  61. (dnsize/1024/1024)::bigint AS dnsize, -- 单位换算为MB
  62. first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn -- --数据量最大的DN
  63. FROM ( -- 获取大于10GB的表
  64. SELECT
  65. schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
  66. FROM (
  67. SELECT
  68. schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
  69. FROM gs_table_distribution()
  70. WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
  71. AND relkind = 'r'
  72. GROUP BY schemaname, tablename
  73. HAVING sum(dnsize) > 50* 1024 * 1024 * 1024.0 -- 总大小大于100GB
  74. )
  75. )
  76. )
  77. GROUP BY schemaname,tablename, skewdn
  78. )
  79. ) t1
  80. INNER JOIN pg_class c ON c.relname = t1.tablename
  81. LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
  82. LEFT JOIN pg_authid a ON a.oid = c.relowner
  83. LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
  84. WHERE c.reloptions::text NOT LIKE '%internal_mask%'
  85. ORDER BY totalsize DESC, diagnostic, skewsize DESC
  86. ;

8.3.0版本使用

  1. -- 大表诊断
  2. SELECT
  3. CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
  4. WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
  5. WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
  6. WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
  7. WHEN (reloptions::text LIKE '%orientation=column%') THEN
  8. CASE WHEN (SELECT total_cu_count > 0 AND (zero_cu_count + small_cu_count)/total_cu_count > 0.5 FROM pgxc_get_small_cu_info(c.oid)) THEN 'small cu table'
  9. ELSE 'normal large table'
  10. END
  11. ELSE 'normal large table'
  12. END AS diagnostic,
  13. t1.schemaname, -- 表的schema
  14. t1.tablename, -- 表名
  15. a.rolname AS tableowner,
  16. x.pgroup AS nodegroup,
  17. CASE x.pclocatortype WHEN 'H' THEN 'Hash'
  18. WHEN 'N' THEN 'Round Robin'
  19. WHEN 'R' THEN 'Replicate'
  20. END AS locatortype,
  21. CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
  22. CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
  23. WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
  24. END AS orientation,
  25. t1.dnnum, -- 表的node group的DN数
  26. t1.totalsize AS "totalsize(MB)", -- 表的size ,单位MB
  27. t1.avgsize AS "avgsize(MB)", -- 平均每个DN上数据量,单位MB
  28. t1.skewsize AS "skewsize(MB)", -- 不同DN上数据size的最大差值,单位MB
  29. t1.skewdn, -- 数据量最大的DN
  30. t1.maxratio, -- 数据量最大DN的size/平均size
  31. t1.minratio, -- 数据量最小DN的size/平均size
  32. t1.skewratio -- 不同DN上数据size的最大差值/平均size
  33. FROM ( -- 预处理,识别倾斜表
  34. SELECT
  35. schemaname,
  36. tablename,
  37. skewdn,
  38. dnnum,
  39. totalsize,
  40. avgsize,
  41. skewsize,
  42. (maxsize/avgsize)::numeric(20,2) AS maxratio,
  43. (minsize/avgsize)::numeric(20,2) AS minratio,
  44. (skewsize/avgsize)::numeric(20,2) AS skewratio
  45. FROM (
  46. SELECT
  47. schemaname,
  48. tablename,
  49. skewdn,
  50. count(1) AS dnnum,
  51. sum(dnsize) AS totalsize,
  52. avg(dnsize) AS avgsize,
  53. max(dnsize) AS maxsize,
  54. min(dnsize) AS minsize,
  55. (max(dnsize) - min(dnsize)) AS skewsize
  56. FROM ( --对每个表的数据按照DN数据量大小排序,以及获取倾斜的dn
  57. SELECT
  58. schemaname,
  59. tablename,
  60. nodename,
  61. (dnsize/1024/1024)::bigint AS dnsize, -- 单位换算为MB
  62. first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn -- --数据量最大的DN
  63. FROM ( -- 获取大于10GB的表
  64. SELECT
  65. schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
  66. FROM (
  67. SELECT
  68. schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
  69. FROM gs_table_distribution()
  70. WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
  71. AND relkind = 'r'
  72. GROUP BY schemaname, tablename
  73. HAVING sum(dnsize) > 50.0 * 1024 * 1024 * 1024 -- 总大小大于100GB
  74. )
  75. )
  76. )
  77. GROUP BY schemaname,tablename, skewdn
  78. )
  79. ) t1
  80. INNER JOIN pg_class c ON c.relname = t1.tablename
  81. LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
  82. LEFT JOIN pg_authid a ON a.oid = c.relowner
  83. LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
  84. WHERE c.reloptions::text NOT LIKE '%internal_mask%'
  85. ORDER BY totalsize DESC, diagnostic, skewsize DESC
  86. ;

针对不同的诊断结果使用如下诊断措施

类别

建议手段

skew table

根据业务选择关联常用,并且数据不倾斜的列作为修改分布列,如果找不到合适的分布列,可以把表修改为RoundRobin分布

ALTER TABLE ctmes_tgmesmbi.mbi_hlottsthisDISTRIBUTE BY ROUNDROBIN;
  • 注意:修改分布列的过程中此表存在双份数据,因此要预留足够的磁盘空间,防止导致磁盘空间过载。
  • ALTER TABLE修改分布列对表持8级锁,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

uncompressed column table

列存表的压缩效果非常好,一般推荐使用压缩,至少使用low级别压缩

  1. ALTER TABLE customer_address SET(compression=low);
  2. VACUUM FULL customer_address;
  • 注意,VACUUM FULL的过程中此表存在双份数据,因此要预留足够的磁盘空间,防止VACUUM FULL过程中导致磁盘空间过载。
  • VACUUM FULL对表持8级锁,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

dirty table

说明表检测碎片率比较高,需要通过VACUUM整理表

VACUUM FULL customer_address;
  • VACUUM FULL的过程中此表存在双份数据,因此要预留足够的磁盘空间,防止VACUUM FULL过程中导致磁盘空间过载。
  • VACUUM FULL对表持8级锁,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

small cu table

说明表小CU比较多,需要通过VACUUM整理表

VACUUM FULL customer_address;
  • VACUUM FULL的过程中此表存在双份数据,因此要预留足够的磁盘空间,防止VACUUM FULL过程中导致磁盘空间过载。
  • VACUUM FULL对表持8级锁,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

large replicattion table

复制表在每个DN上都有一份全量数据,当表磁盘空间占用过大时,需要把表修改为HASH表。一般复制表都是维表,存在主键,直接把分布列修改为主键

ALTER TABLE ctmes_tgmesmbi.mbi_hlottsthisDISTRIBUTE BY HASH(id);

normal large table

3. 冗余索引诊断

目的:识别冗余索引,建议客户删除。可以降低磁盘空间,并降低大规模数据导入的时候的xlog规模

  1. -- optimizable policy为duplicate的检查项
  2. -- 表明两个索引字段和字段顺序完全一致
  3. -- 建议直接删除optimizable index指定的索引;
  4. -- optimizable policy为redundancy检查项表明
  5. -- optimizable index指定的索引的索引列刚好是base index的索引列的前面字段
  6. -- 建议直接删除optimizable index指定的索引;
  7. -- optimizable policy为optimizable检查项
  8. -- 表明optimizable index和base index这两个索引的索引列完全重复,但是索引列的顺序不一致
  9. -- 这种场景需要人工介入分析是否可以优化
  10. WITH info AS(
  11. SELECT
  12. quote_ident(n.nspname) || '.' || quote_ident(c.relname) AS tablename,
  13. pgroup AS nodegroup,
  14. x.indrelid AS indrelid,
  15. x.indexrelid AS indexrelid,
  16. indisunique,
  17. indisprimary,
  18. indnatts,
  19. indkey,
  20. indexprs
  21. FROM pg_index x
  22. INNER JOIN pg_class c ON c.oid = x.indrelid
  23. INNER JOIN pg_class i ON i.oid = x.indexrelid
  24. LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
  25. INNER JOIN pgxc_class xc ON xc.pcrelid = c.oid
  26. WHERE c.relkind = 'r' AND c.oid >= 16384 AND (c.reloptions IS NULL OR c.reloptions::text NOT LIKE '%internal_mask%')
  27. AND i.relkind = 'i' AND i.oid >= 16384
  28. AND x.indpred IS NULL
  29. ),
  30. base AS(
  31. SELECT
  32. tablename,
  33. nodegroup,
  34. i.indrelid,
  35. i.indexrelid baseidx,
  36. i.indisunique AS base_unique,
  37. i.indisprimary AS base_primary,
  38. x.indexrelid AS optidx,
  39. x.indisunique AS opt_unique,
  40. x.indisprimary AS opt_primary,
  41. CASE WHEN opt_primary > base_primary OR opt_unique > base_unique THEN true ELSE false END AS swap,
  42. CASE WHEN i.indkey = x.indkey AND coalesce(pg_get_expr(i.indexprs, i.indrelid), 'NULL') = coalesce(pg_get_expr(x.indexprs, x.indrelid), 'NULL') THEN 'duplicate'::text
  43. WHEN x.indexprs IS NOT NULL OR i.indexprs IS NOT NULL THEN NULL::text
  44. WHEN strpos(i.indkey::text, x.indkey::text||' ') = 1 OR strpos(x.indkey::text, i.indkey::text||' ') = 1 THEN 'redundancy'::text
  45. WHEN i.indkey @> x.indkey AND x.indkey @> i.indkey THEN 'optimizable'::text
  46. ELSE NULL
  47. END AS optpolicy
  48. FROM info i
  49. INNER JOIN pg_index x ON (i.indrelid = x.indrelid AND i.indexrelid > x.indexrelid)
  50. WHERE x.indpred IS NULL AND optpolicy IS NOT NULL
  51. ),
  52. tmp AS(
  53. SELECT
  54. tablename,
  55. indrelid,
  56. nodegroup,
  57. CASE WHEN swap THEN optidx ELSE baseidx END AS base_idx,
  58. CASE WHEN swap THEN opt_primary ELSE base_primary END AS base_primary,
  59. CASE WHEN swap THEN opt_unique ELSE base_unique END AS base_unique,
  60. CASE WHEN swap THEN baseidx ELSE optidx END AS opt_idx,
  61. CASE WHEN swap THEN base_primary ELSE opt_primary END AS opt_primary,
  62. CASE WHEN swap THEN base_unique ELSE opt_unique END AS opt_unique,
  63. optpolicy
  64. FROM base
  65. )
  66. SELECT
  67. tablename,
  68. nodegroup,
  69. base_idx::regclass::text AS base_index,
  70. base_primary,
  71. base_unique,
  72. substring(pg_get_indexdef(base_idx) from 'USING .+\)') AS base_idxdef,
  73. opt_idx::regclass::text AS opt_index,
  74. opt_primary,
  75. opt_unique,
  76. substring(pg_get_indexdef(opt_idx) from 'USING .+\)') AS opt_idxdef,
  77. optpolicy,
  78. pg_get_tabledef(indrelid)
  79. FROM tmp
  80. ORDER BY 1, 2, 3
  81. ;

点击关注,第一时间了解华为云新鲜技术~

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/273166
推荐阅读
相关标签
  

闽ICP备14008679号