The documentation says the following about Partition Pruning:
Does anyone know if this actually works? If it does how can I tell? I do not see anything about "Partition Pruning" in the explain plan:When a query predicate includes one or more columns in the partitioning clause, queries look only at relevant ROS containers.
Code: Select all
dbadmin=> create table test (a_year date not null) partition by extract(year from a_year)::int;
CREATE TABLE
dbadmin=> insert into test values ('01/01/1987');
OUTPUT
--------
1
(1 row)
dbadmin=> insert into test values ('01/01/1988');
OUTPUT
--------
1
(1 row)
dbadmin=> insert into test values ('01/01/1989');
OUTPUT
--------
1
(1 row)
dbadmin=> insert into test values ('01/01/1990');
OUTPUT
--------
1
(1 row)
dbadmin=> commit;
explain select a_year from test where a_year = '01/01/1987';
Access Path:
+-STORAGE ACCESS for test [Cost: 5, Rows: 1] (PATH ID: 1)
| Projection: public.test_super
| Materialize: test.a_year
| Filter: (test.a_year = '1987-01-01'::date)
Thank you!