Hi Jared and Sergei.
I've been doing some work with Postgresql, and have learned more about
how partial indexes are used.
It seems partial indexes are a general "design pattern" they use to:
1) have smaller indexes by including less rows
2) reduce write-amplification performance issues
as Postgresql likes to update all table indexes on each update (see #1)
PG Patch: Write Amplification Reduction Method (WARM)
3) accomplish various "tricks" similar to the null unique index we discussed:
Indexing an ip range within an access_log table is an interesting use case above.
I might use partial indexes for OLAP applications (drop indexes, load data, add partial index.)
And potentially smaller indexes is nice while using relatively small SSDs.
Thanks, James.
From: Jared Beck <jared@jaredbeck.com>
To: Sergei Golubchik <serg@mariadb.org>
Cc: maria-developers@lists.launchpad.net
Sent: Thursday, December 28, 2017 8:37 AM
Subject: Re: [Maria-developers] Partial indexes?
On Thu, Dec 28, 2017 at 9:34 AM, Sergei Golubchik <
serg@mariadb.org> wrote:
> In MariaDB (and in SQL standard) the way to achieve that
> would be to use a nullable column for active, and mark inactive users
> with NULL. Then you can create a unique index on (phone,active).
That is a neat trick, thanks James and Sergei!
--
Jared Beck • (607) 216-5373 •
jared@jaredbeck.com