Partitioned Table ... Querying whole Hypertable results in Seq Scans, but Querying a Sub-hypertable Results in Index Scan

From: Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Partitioned Table ... Querying whole Hypertable results in Seq Scans, but Querying a Sub-hypertable Results in Index Scan
Date: 2018-01-22 18:53:10
Message-ID: CY1PR0601MB1927C0180C1FAF8F3B65E73EE5EC0@CY1PR0601MB1927.namprd06.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a 2-level partitioned table where the first partition is on one range variable and the second on an list that simply ranges from 1 to 5.

When I query the whole hypertable on a nice, small subset, the planner resorts to sequential scans (on the "seven_lima[date]tango_seven2" tables), making the query untenably long to work with:
https://explain.depesz.com/s/inM4

However, when I query one level down, the scan of the primary table (papa) is a nice, proper, quite fast Index Scan
https://explain.depesz.com/s/8JQ4

What is going on here, and how can I fix it?
________________________________
Stephen Froehlich
Sr. Strategist, CableLabs(r)

s(dot)froehlich(at)cablelabs(dot)com<mailto:s(dot)froehlich(at)cablelabs(dot)com>
Tel: +1 (303) 661-3708

Browse pgsql-novice by date

  From Date Subject
Next Message ferraresso@tin.it 2018-01-23 13:03:08 R: Re: R: Re: create subscription, connection string, password in log not hide
Previous Message Laurenz Albe 2018-01-22 18:51:50 Re: R: Re: create subscription, connection string, password in log not hide