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