7.8. Indexes

The more records you want to store in a table, the longer it will take to find the appropriate values because the database has to check every record in the table at least once to generate the result. If you are working with millions of records, this will take far too long and the performance of your application will suffer if the number of records in the database increases.

Trees are a fundamental data structure and can be used to speed up the access to huge amounts of data. Indexes (non-American readers will spell the plural of the word index as indices, which is the correct Latin plural of the word) are based on trees, and in this section you will learn how to create and drop indexes. You will also have a brief look at PostgreSQL ...

Get PHP and PostgreSQL: Advanced Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.