Hello Postgresql users,
Suppose the table 'attendance' is very large:
id bigint
student_name varchar
late
booleanrecord_timestamp timestamp
The table is already partitioned by year (attendance_2012p, attendance_2013p, ...).
I would like to count the number of lates by year.
Instead of specifying the partition tables name:
select count(*) from attendance_2012p where student_name="Student A" and late='true';
select count(*) from attendance_2013p where student_name="Student A" and late='true';select count(*) from attendance_2014p where student_name="Student A" and late='true';
...
Is it possible to query the master table attendance), and the query could make use of the partitioned table for faster query?
Thanks and regards,
Patrick