0
0
PostgreSQLquery~10 mins

BRIN index for large sequential data in PostgreSQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a BRIN index on the column 'event_time' in the 'logs' table.

PostgreSQL
CREATE INDEX brin_event_time_idx ON logs USING [1] (event_time);
Drag options to blanks, or click blank then click option'
Abtree
Bbrin
Chash
Dgin
Attempts:
3 left
💡 Hint
Common Mistakes
Using btree instead of brin for large sequential data.
Using gin or hash which are for different use cases.
2fill in blank
medium

Complete the code to create a BRIN index with a pages_per_range of 128 on the 'event_time' column.

PostgreSQL
CREATE INDEX brin_event_time_idx ON logs USING brin (event_time) WITH (pages_per_range = [1]);
Drag options to blanks, or click blank then click option'
A128
B64
C256
D32
Attempts:
3 left
💡 Hint
Common Mistakes
Using too small or too large values for pages_per_range.
Confusing pages_per_range with other parameters.
3fill in blank
hard

Fix the error in the code to create a BRIN index on 'event_time' with the correct syntax for options.

PostgreSQL
CREATE INDEX brin_event_time_idx ON logs USING brin (event_time) WITH ([1] = 128);
Drag options to blanks, or click blank then click option'
Apages_per_ranges
Bpage_per_range
Cpages_per_range
Dpage_per_ranges
Attempts:
3 left
💡 Hint
Common Mistakes
Using singular 'page_per_range' instead of plural.
Adding extra 's' or misspelling the option name.
4fill in blank
hard

Fill both blanks to create a BRIN index on 'event_time' with autosummarize disabled.

PostgreSQL
CREATE INDEX brin_event_time_idx ON logs USING [1] (event_time) WITH (autosummarize = [2]);
Drag options to blanks, or click blank then click option'
Abrin
Btrue
Cfalse
Dbtree
Attempts:
3 left
💡 Hint
Common Mistakes
Using btree instead of brin for the index type.
Setting autosummarize to true when the task asks to disable it.
5fill in blank
hard

Fill all three blanks to create a BRIN index on 'event_time' with pages_per_range 64 and autosummarize enabled.

PostgreSQL
CREATE INDEX brin_event_time_idx ON logs USING [1] (event_time) WITH (pages_per_range = [2], autosummarize = [3]);
Drag options to blanks, or click blank then click option'
Abtree
B64
Ctrue
Dbrin
Attempts:
3 left
💡 Hint
Common Mistakes
Using btree instead of brin.
Confusing true and false for autosummarize.
Using wrong values for pages_per_range.