Issue (#49): Duplicates in pg_stat_monitor.

Jira: PG-139
This commit is contained in:
Ibrar Ahmed
2020-10-10 22:46:53 +00:00
parent db01ed546b
commit dea16f1878
3 changed files with 85 additions and 71 deletions

View File

@@ -73,8 +73,12 @@ pgss_shmem_startup(void)
pgss->query_buf_size_bucket = PGSM_QUERY_BUF_SIZE / PGSM_MAX_BUCKETS;
for (i = 0; i < PGSM_MAX_BUCKETS; i++)
{
unsigned char *buf;
pgss_qbuf[i] = (unsigned char *) ShmemAlloc(pgss->query_buf_size_bucket);
buf = pgss_qbuf[i];
memset(buf, 0, sizeof (uint64));
}
pgss_hash = hash_init("pg_stat_monitor: Queries hashtable", sizeof(pgssHashKey), sizeof(pgssEntry),PGSM_MAX);
pgss_buckethash = hash_init("pg_stat_monitor: Bucket hashtable", sizeof(pgssBucketHashKey), sizeof(pgssBucketEntry), PGSM_MAX_BUCKETS);