DBA Hub

📋Steps in this guide1/1

Create Partial index in postgres

Partial index, means index will be created on a specific subset of data of a table.

postgresql configurationintermediate
by PostgreSQL
12 views
1

Create Partial index in postgres

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
Partial index, means index will be created on a specific subset of data of a table.
edbstore=>
create index part_emp_idx on orders(tax) where tax > 400;
CREATE INDEX
edbstore=>
\d part_emp_idx
Index "edbuser.part_emp_idx"
Column  | Type          | Key? | Definition
--------+---------------+------+------------
tax     | numeric(12,2) | yes  | tax
btree, for table "edbuser.orders", predicate (tax > 400::numeric)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!