Re: partitioned table set and indexes - Mailing list pgsql-performance

From Andreas Kretschmer
Subject Re: partitioned table set and indexes
Date
Msg-id 1203683949.315121.1449870245520.JavaMail.open-xchange@oxweb02.ims-firmen.de
Whole thread Raw
In response to Re: partitioned table set and indexes  (Rick Otten <rottenwindfish@gmail.com>)
Responses Re: partitioned table set and indexes
List pgsql-performance

> Rick Otten <rottenwindfish@gmail.com> hat am 11. Dezember 2015 um 21:40
> geschrieben:
>
>
> I do not know why if I blast a new index creation on the 20 or so children
> all at once some of them fail, but then if I go back and do a few at a time
> they all work.  It has happened to me 3 times now, so I'm pretty sure I'm
> not imagining it.

don't believe that, sorry.


>
> What specifically in the explain analyze output tells you that it is using
> a sequence scan instead of an index scan _because_ there are too few rows?
> I can see where it chooses a sequence scan over an index and I know there
> are only a few rows in those tables, but I'm not sure how the explain
> output tells you that it made that choice on purpose.

a sequentiell scan over a small table are cheaper than an index-scan. Imageine a
small table,
only 3 rows. Fits in one page. It's cheaper to read just this page than read the
index
plus read the table to put out the result row.


Why are you using partitioning? That's make only sense with large child-tables
(more than 1 million rows or so)
and if you have a proper partitioning schema.



>
> Why would the select statement use the index, but not the join?
>
> There used to be an explain output anonymizer tool, if I can find that
> again, I'll send along the output.  It has been a few years since I posted
> a question to this list so I don't think I have a bookmark for it any
> more.... Hmmm.  I'll look around.


http://explain.depesz.com/


pgsql-performance by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: partitioned table set and indexes
Next
From: Rick Otten
Date:
Subject: Re: partitioned table set and indexes