Answers for "check index for table postgres"

SQL
1

postgres how to index a column

CREATE INDEX index_name 
ON table_name(column_name);
Posted by: Guest on June-10-2021
0

postgresql index id

postgres@db # SELECT a.attname
FROM pg_class t
     JOIN pg_index ix ON t.oid = ix.indrelid
     JOIN pg_class i ON i.oid = ix.indexrelid
     JOIN pg_attribute a ON a.attrelid = t.oid
WHERE 
     a.attnum = ANY(ix.indkey) AND 
     t.relkind = 'r' AND 
     t.relname ='test' -- table name
ORDER BY
     t.relname,
     i.relname;
 attname 
---------
 column1
 column2
 id
(3 rows)
Posted by: Guest on March-16-2021

Code answers related to "check index for table postgres"

Code answers related to "SQL"

Browse Popular Code Answers by Language