2

In order to define a GIN index on an array and scalar field (for example) you need to enable the btree_gin extension in PostgreSQL. Then you can define your indexes as a GIN index.

However I don't understand if, under the hood, PostgreSQL is using a btree structure or a GIN structure.

asked Jan 16, 2020 at 12:08
0

2 Answers 2

2

Both. GIN indexes internally make use of a btree data structure. It is not identical to the btree data structure used in a proper BTREE index, but they share the same principles.

answered Jan 16, 2020 at 22:09
0

The resulting index is a true blood GIN index. These operator classes are not installed by default because they are rarely needed.

A single-column GIN index on a column of scalar type would be inferior to a B-tree index in almost every way.

answered Jan 16, 2020 at 17:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.