You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To create an index with a specified property, the exact property will be accessed using the JSONB operator ->, the syntax will look like this. CREATE INDEX imdb ON munmud."Movie" USING gin ((properties->'imdbRank'));
I am also confused in this.
I think apache age does not support creating index on a specific property. Once you create an index it would create index on all the labels. Which means if you create an index it will contain all the properties of the labeled nodes.
Like @Chidera6 said, the query creates a GIN index on the imdbRank property of the Movie nodes in the munmud graph. The GIN index is a versatile index structure suitable for efficiently querying and filtering JSONB data, which is the data type of the properties column in this case.
You can use the query SELECT * FROM pg_indexes WHERE tablename = 'Movie'; to retrieve information about the indexes associated with the table named Movie in the 'munmud' schema.
The output should be something like this:
schemaname | tablename | indexname | tablespace | indexdef
------------+-----------+-----------+------------+------------------------------------------------------------------------------------
munmud | Movie | imdb | | CREATE INDEX imdb ON munmud."Movie" USING gin (((properties -> 'imdbRank'::text)))
(1 row)
You can see the indexname 'imdb', the indexdef column in the result shows the definition of the index, including the index type (gin in this case) and the expression used for indexing (((properties -> 'imdbRank'::text))).
Activity
Chidera6 commentedon May 31, 2023
To create an index with a specified property, the exact property will be accessed using the JSONB operator
->, the syntax will look like this.CREATE INDEX imdb ON munmud."Movie" USING gin ((properties->'imdbRank'));talhahahae commentedon May 31, 2023
I am also confused in this.
I think apache age does not support creating index on a specific property. Once you create an index it would create index on all the labels. Which means if you create an index it will contain all the properties of the labeled nodes.
dukeofhazardz commentedon May 31, 2023
Like @Chidera6 said, the query creates a GIN index on the
imdbRankproperty of the Movie nodes in themunmudgraph. The GIN index is a versatile index structure suitable for efficiently querying and filtering JSONB data, which is the data type of the properties column in this case.You can use the query
SELECT * FROM pg_indexes WHERE tablename = 'Movie';to retrieve information about the indexes associated with the table namedMoviein the 'munmud' schema.The output should be something like this:
You can see the
indexname'imdb', theindexdefcolumn in the result shows the definition of the index, including the index type (ginin this case) and the expression used for indexing (((properties -> 'imdbRank'::text))).