A database management system is software that defines, stores, queries and updates databases while managing access, integrity and concurrent use. Its components can include a query parser, optimizer, storage manager, transaction manager and recovery mechanism. A database is the managed collection; the database management system supplies the mechanisms and interfaces used to operate on it.
For example, evaluating
SELECT name FROM Person WHERE id = 7 requires interpreting the query, choosing an access path, retrieving visible records and returning the selected field. An index can speed the lookup without changing its logical result. Concurrent updates may require locks or versions, and a crash may require log replay. Merely writing records to a file does not supply those guarantees. PostgreSQL's tutorial illustrates the distinction between client applications, the server process managing database files and connections, and the databases accessed through that server.[ref]Concepts in the PostgreSQL documentation. §2.2, client/server architecture and database organization
A database index is an auxiliary data structure that helps a database management system locate records satisfying selected conditions. It stores information organized for an access pattern, such as searching a column value, without requiring every database tuple to be inspected. The database query still specifies the result; the index supplies a possible route to it.[ref]
Introduction to Indexes in the PostgreSQL documentation. §11.1, indexed lookup example and maintenance costs
For example, a database relation with a million samples can have an index on
sample_id. Looking for one identifier can follow a search structure instead of scanning all rows. A condition matching most rows may still favor a scan, since many separate lookups and row fetches can cost more. The index occupies storage and must be maintained on relevant updates. These costs explain why indexing every column is not automatically the best design.PostgreSQL is an open-source object-relational database management system supporting SQL, database transactions, constraints and extensible data types. It manages stored relations and concurrent access through a server, rather than merely defining a database query language. The project descends from the Berkeley POSTGRES system.[ref]
What Is PostgreSQL? in the PostgreSQL documentation. Preface §1, origins and supported features
For example,
SELECT name FROM samples WHERE reading > 5 requests selected rows without prescribing their physical access path. A database index can accelerate retrieval, while database transactions govern the visibility and consistency of related updates. A database relation has no implicit presentation order: a caller needing sorted rows must request an ordering.[ref]Concepts in the PostgreSQL documentation. §2.2, relations, columns and unspecified row order
These distinctions separate logical results from storage organization and display.