There are some columns that I wish to create indexes for to improve look-up and sorting speeds. If that column is marked as UNIQUE
, for instance:
CREATE TABLE "foo" ( "bar" TEXT NOT NULL UNIQUE )
is the column "bar" now indexed in such a way that this:
CREATE INDEX foo_bar ON foo(bar)
will provide no speed bonus for searches and sorts?
UNIQUE
and PRIMARY KEY
constraints indeed create an internal index to speed up their lookups, so you do not need to create your own.
(see the documentation)
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