From: Valerii Valeev <valerii.valeev@mail.ru>
To: pgsql-performance@postgresql.org
Subject: why we do not create indexes on master
Date: Tue, 27 Dec 2016 18:22:13 +0300
Message-ID: <01F901FD-F29D-4A46-ACB4-4E6FD75EE7E6@mail.ru> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Dear colleagues,
can anyone please explain, why we do not create indexes on master?
In my case master / child design blindly follows partitioning guide https://www.postgresql.org/docs/9.6/static/ddl-partitioning.html <https://www.postgresql.org/docs/9.6/static/ddl-partitioning.html;.
My collaborator was unhappy with performance of queries over master table with filtering by one of fields
SELECT * FROM “master" WHERE “field" BETWEEN x AND y
(there are indexes for “field” on child tables).
He has created index on master once and found that the query returns 100x faster.
I have naive idea that it won’t help if index is created before the data is there — i.e. indexes on master aren’t updated when data loaded to child table.
I’m curious is it right or it’s something less primitive.
Thanks and have a happy holidays!
Val.=
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: valerii.valeev@mail.ru
Subject: Re: why we do not create indexes on master
In-Reply-To: <01F901FD-F29D-4A46-ACB4-4E6FD75EE7E6@mail.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox