Create/drop index commands in postgres
-- Simple create index: postgres=# create index tab_idx2 on scott.customer(emp_name); CREATE INDEX
postgresql configurationintermediate
by PostgreSQL
14 views
-- Simple create index: postgres=# create index tab_idx2 on scott.customer(emp_name); CREATE INDEX
12345678910111213141516171819202122232425262728
-- Simple create index:
postgres=#
create index tab_idx2 on scott.customer(emp_name);
CREATE INDEX
-- Create index with tablespace:
postgres#
CREATE INDEX tab_idx2 on scott.customer(emp_name) TABLESPACE IND_TS;
CREATE INDEX
-- Create index without causing blocking:
postgres=#
create index concurrently tab_idx2 on scott.customer(emp_name) TABLESPACE IND_TS;
CREATE INDEX
-- Create unique index:
postgres=#
create unique index tab_idx2 on scott.customer(emp_name)
CREATE INDEX
-- Create functional index:
postgres=#
create index fun_idx on scott.customer(lower(emp_name));
CREATE INDEX
-- Create multi column index:
postgres=#
create index multi_idx on scott.customer(emp_name,emp_id);
CREATE INDEX
-- drop an index:
postgres=#
drop index fun_idx;
DROP INDEXPlease to add comments
No comments yet. Be the first to comment!