If I have a table like so:
Food
-----------------
name | price | x
Let's say I create an index on name & price, but the database has a bunch of null values for both name & price in some of the rows. Does PostgreSQL automatically skip indexing those rows?
NULL values ARE indexed as well.
You can also use an index to speed up queries with a condition like
WHERE col IS NULL
Something that may come as a surprise to Oracle users is that you can have several rows with a NULL in a unique index. But that makes sense because NULL = NULL
is not true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With