What are the advantages and disadvantages of using the "Partial Index"?

PostgreSQL allows you to create "partial indexes", which are mainly indexes with conditional predicates. http://www.postgresql.org/docs/8.2/static/indexes-partial.html

During testing, I found that they work very well for the case when the query has access to only some 12 rows in a table with 120 thousand rows.

But before we apply this, are there any flaws or reservations we should be aware of?

+3
source share
2 answers

- . , , .

Orders, , order_status :

  • 5%
  • 2%
  • 5%
  • 85%
  • 3%

where order_status = 'New', , , . 12 120k .

+6

Pro:

, , . ,

Con:

, , , .

+4

Source: https://habr.com/ru/post/1699447/


All Articles