Postgresql easy
PostgreSQL provides first-class support for Array data types. What is a common use-case for this feature in a relational schema?
- A Storing every column of the table in a single row to improve disk I/O speed.
- B Storing a list of values (e.g., tags) in a single column without a join table.
- C Enabling the use of standard SQL JOINs on data stored in an external CSV file.
- D Translating integer values into their corresponding binary strings automatically.
Answer: B. Storing a list of values (e.g., tags) in a single column without a join table.
While traditional normalization suggests a separate join table, native arrays (like `text[]`) are useful for simple attributes like tags or phone numbers, especially since they can be indexed via GIN for high performance.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a PostgreSQL environment, what functional characteristic distinguishes a `MATERIALIZED VIEW` from a standard `VIEW`?
- Which standard PostgreSQL utility is designed to extract a single database into a script or archive file for backup purposes?
- Why would PostgreSQL reject a `DELETE` operation on a record despite the user having full administrative privileges?
- The 'Heap Only Tuples' (HOT) optimization improves UPDATE performance. Which specific set of conditions must be met for a HOT update to occur?
- Which native command-line utility is used to execute SQL queries and manage PostgreSQL databases from a terminal session?
- What is the specific purpose of 'Freezing' a row (modifying its `xmin` status) during a major VACUUM operation?