Hi,

I'm running simple range query on partitioned table. It is creating the huge number of Accesssharelocks which is causing the out of shared memory error.

Code:
SELECT * FROM test WHERE date_dt BETWEEN '2015-01-01' AND '2015-01-31'      (Around 100 rows)
partitioned key => date_dt

Postgres version: PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit

Code:
select a.pid, b.usename, count(a.mode) from pg_locks a join pg_stat_activity b
on a.pid=b.pid
group by a.pid,b.usename order by count desc;

10944	test_user	2571
Only single user accessing this table still it is creating so many locks.

Any idea why it is creating so many locks? Any help would be really appreciated.

Thanks
Mohammad