Postgresql easy
What is the specific architectural role of the `tsvector` data type in PostgreSQL integrated full-text searching?
- A It stores the raw search query provided by the application and handles regex parsing.
- B It represents a document as a sorted list of unique lexemes optimized for fast matching.
- C It provides a pointer to an external Elasticsearch cluster for offloaded search tasks.
- D It acts as a temporary buffer for sorting query results before they reach the NIC buffer.
Answer: B. It represents a document as a sorted list of unique lexemes optimized for fast matching.
`tsvector` is a document reduced to its searchable form (lexemes). Combined with an index, it allows the database to perform complex full-text searches (with stemming and ranking) directly within SQL.
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?