HashTable KeySize - Mailing list pgsql-hackers

From Natarajan R
Subject HashTable KeySize
Date
Msg-id CAPqxBt7jJ8JMqmUoSJm7TCfBAa-KAgpap6+kUAE3Pr6i+Ec6ig@mail.gmail.com
Whole thread Raw
Responses Re: HashTable KeySize
List pgsql-hackers
typedef struct HashTableKey
{
  Oid dbId; // 4 bytes
  int64 productid; // 8 bytes
}HashTableKey; (total size - 12 bytes)

typedef struct HashTableEntry
{
  HashTableKey key;
  ProductInfo *pdt;
}HashTableEntry;

HASHCTL hashInfo;
hashInfo.keysize = sizeof(HashTableKey);
hashInfo.entrysize = sizeof(HashTableEntry);
SampleHashTable = ShmemInitHash("productid vs product struct HashTable", size, size, &hashInfo, HASH_ELEM | HASH_SHARED_MEM | HASH_BLOBS);

while printing keysize: elog(LOG,"Keysize = %d",sizeof(HashTableKey));

I am getting Keysize = 16, How? what should i need to do inorder to have keysize = 12

pgsql-hackers by date:

Previous
From: Asif Rehman
Date:
Subject: Re: WIP/PoC for parallel backup
Next
From: Anastasia Lubennikova
Date:
Subject: Re: pg_upgrade fails with non-standard ACL