Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-23 Thread PT
On Fri, 23 Feb 2018 17:10:56 +1300 David Rowley wrote: > On 23 February 2018 at 04:00, Bill Moran wrote: > > 2) The negative impact of an unused index is tiny compared to the negative > > impact of a missing index. > > I'd say that would

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread David Rowley
On 23 February 2018 at 04:00, Bill Moran wrote: > 2) The negative impact of an unused index is tiny compared to the negative > impact of a missing index. I'd say that would entirely depend on the workload of the table and the entire cluster. Disk space and I/O to write

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread Bill Moran
On Thu, 22 Feb 2018 03:57:34 +0100 Tomas Vondra wrote: > > On 02/21/2018 05:00 PM, Bill Moran wrote: > > On Wed, 21 Feb 2018 13:33:18 +0100 > > Alexander Farber wrote: > > > >> Hi Martin - > >> > >> On Wed, Feb 21, 2018 at 1:26 PM,

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-22 Thread Alexander Farber
Thank your for the comments

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-21 Thread Tomas Vondra
On 02/21/2018 05:00 PM, Bill Moran wrote: > On Wed, 21 Feb 2018 13:33:18 +0100 > Alexander Farber wrote: > >> Hi Martin - >> >> On Wed, Feb 21, 2018 at 1:26 PM, Martin Moore >> wrote: >> >>> I’m no expert but I’d think it unlikely an index

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-21 Thread Martin Moore
My point was that your explain would be the same with indexes as without as they won’t be used. Martin. From: Alexander Farber Date: Wednesday, 21 February 2018 at 12:33 Cc: pgsql-general Subject: Re: Not sure if I should CREATE

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-21 Thread Alexander Farber
Here is the current DESC of the table (I already use few joins): words=> \d words_games Table "public.words_games" Column | Type | Collation | Nullable | Default

Re: Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-21 Thread Alexander Farber
Hi Martin - On Wed, Feb 21, 2018 at 1:26 PM, Martin Moore 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

Not sure if I should CREATE INDEX for text columns on which I plan to filter later

2018-02-21 Thread Alexander Farber
Hello, in a 2 player game I store all games in the following PostgreSQL 10.2 table: CREATE TABLE words_games ( gid SERIAL PRIMARY KEY, created timestamptz NOT NULL, finished timestamptz, player1 integer REFERENCES words_users(uid) ON DELETE CASCADE NOT NULL