From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alexander Farber <alexander.farber@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later
Date: Thu, 22 Feb 2018 03:49:45 +0100
Message-ID: <f07da9ed-9d6d-1a22-4b5a-a5cda5bf29f4@2ndquadrant.com> (raw)
In-Reply-To: <CAADeyWiEQvKv5oA2q+F6auRDzk3svBL1=KK_wKSd+tNmrC5R9w@mail.gmail.com>
References: <CAADeyWi2b_nO+SquOz7sSF2iaAyM2WhJjKX8bQdFYuDhewJqKw@mail.gmail.com>
<C727B340-40F8-4E18-846A-C1E6F14181D8@avbrief.com>
<CAADeyWiEQvKv5oA2q+F6auRDzk3svBL1=KK_wKSd+tNmrC5R9w@mail.gmail.com>
On 02/21/2018 01:33 PM, Alexander Farber wrote:
> Hi Martin -
>
> On Wed, Feb 21, 2018 at 1:26 PM, Martin Moore <martin.moore@avbrief.com
> <mailto:martin.moore@avbrief.com>> wrote:
>
> I’m no expert but I’d think it unlikely an index would be considered
> for a table with only 100 rows in. Also I’m pretty sure only one
> index per table is used, so you’d want to put state1 and state2 in
> one index.
>
>
> I hope to have more records in the words_games table later when my game
> is launched (currently in soft launch/beta).....
>
I do strongly recommend generating a representative amount of data as
part of testing, and making sure all the indexes are there before going
live. Otherwise you'll be playing whack-a-mole over a long period of
time, depending on how fast the individual tables grow.
Either setup a script that generates data through the application, or
generate synthetic data in some other way.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, alexander.farber@gmail.com
Subject: Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later
In-Reply-To: <f07da9ed-9d6d-1a22-4b5a-a5cda5bf29f4@2ndquadrant.com>
References: <CAADeyWi2b_nO+SquOz7sSF2iaAyM2WhJjKX8bQdFYuDhewJqKw@mail.gmail.com> <C727B340-40F8-4E18-846A-C1E6F14181D8@avbrief.com> <CAADeyWiEQvKv5oA2q+F6auRDzk3svBL1=KK_wKSd+tNmrC5R9w@mail.gmail.com> <f07da9ed-9d6d-1a22-4b5a-a5cda5bf29f4@2ndquadrant.com>
* 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