Sequential scan
The previous examples (and many in Chapter 9, Database Indexing) have shown you plenty of examples of tables being scanned sequentially. You can expect a Seq Scan when there isn't a useful index, or when such a large portion of the table is expected to be returned so that using an index would just add needless overhead. They'll also be used when there is only a very small amount of data to access; the index overhead is disproportionately large if the table takes up only a few pages on disk.
Note that a Seq Scan must read through all the dead rows in a table, but will not include them in its output. It's therefore possible for their execution to take much longer than would be expected to produce all the required output if the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access