Search Postgresql Archives

constraint partition issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please help me understanding this execution plan :
I have a table and  3 levels of partitions .
All  the tables on second level have date constraints.
 
Execution plan shows that all partitions are checked by the optimizer,
Nothing is excluded. My test example worked fine but this one does not.
 
Thank you for help.
Helen
 
CREATE TABLE summary_total
(
  counter bigint DEFAULT 0,
  destgeo_id integer DEFAULT 1,
  direction integer DEFAULT 1,
  mlapp_id integer DEFAULT 1
)
 
CREATE TABLE summary_daily_data
(
)
INHERITS (summary_total)
 
CREATE TABLE summ_dly_1505500
(
)
INHERITS (summary_daily_data)
ALTER TABLE summ_dly_1505500
  ADD CONSTRAINT ch_date CHECK
(datex >= '2011-03-22 00:00:00'::timestamp without time zone AND
datex < '2011-03-23 00:00:00'::timestamp without time zone);
 
CREATE TABLE summ_dly_1505600
(
)
INHERITS (summary_daily_data)
ALTER TABLE summ_dly_1505600
  ADD CONSTRAINT ch_date CHECK
(datex >= '2011-03-23 00:00:00'::timestamp without time zone AND
datex < '2011-03-24 00:00:00'::timestamp without time zone);
 
CREATE TABLE summ_dly_1505600
(
)
INHERITS (summary_daily_data)
ALTER TABLE summ_dly_1505600
  ADD CONSTRAINT ch_date CHECK
(datex >= '2011-03-23 00:00:00'::timestamp without time zone AND
datex < '2011-03-24 00:00:00'::timestamp without time zone);
 
 
CREATE TABLE summ_dly_1505700
(
)
INHERITS (summary_daily_data)
ALTER TABLE summ_dly_1505700
  ADD CONSTRAINT ch_date CHECK
(datex >= '2011-03-24 00:00:00'::timestamp without time zone AND
datex < '2011-03-25 00:00:00'::timestamp without time zone);
 
 
 
explain select * from summary_daily_data
where datex = '2011-03-24 00:00:00'::timestamp without time zone;
 
 
"Result  (cost=0.00..8559.68 rows=1722 width=73)"
"  ->  Append  (cost=0.00..8559.68 rows=1722 width=73)"
"        ->  Seq Scan on summary_daily_data  (cost=0.00..19.88 rows=4 width=73)"
"              Filter: (datex = '2011-03-24 00:00:00'::timestamp without time zone)"
"        ->  Seq Scan on summ_dly_1505500 summary_daily_data  (cost=0.00..19.88 rows=4 width=73)"
"              Filter: (datex = '2011-03-24 00:00:00'::timestamp without time zone)"
"        ->  Seq Scan on summ_dly_1505600 summary_daily_data  (cost=0.00..19.88 rows=4 width=73)"
"              Filter: (datex = '2011-03-24 00:00:00'::timestamp without time zone)"
"        ->  Seq Scan on summ_dly_1505700 summary_daily_data  (cost=0.00..19.88 rows=4 width=73)"
"              Filter: (datex = '2011-03-24 00:00:00'::timestamp without time zone)"
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux