Home > database > PostgreSQL such statements should be how to create an index
PostgreSQL such statements should be how to create an index
Time:09-27
The original statement: select the userinfo - & gt;> The teacher as the name, the count (*) from the users group by the userinfo - & gt;> The class; From the point of this statement, adding indexes should be?
CodePudding user response:
The userinfo is a jsonb data is roughly is {" the teacher ":" jack ", "class" : "6", "name" : "John"}
CodePudding user response:
Or build b-tree indexes, The create index idx_ui_class on users using btree ((the userinfo - & gt;> The class));