Re: gsoc, store hash index tuple with hash code only

From: "Xiao Meng" <mx(dot)cogito(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: gsoc, store hash index tuple with hash code only
Date: 2008-07-16 10:29:28
Message-ID: ded849dd0807160329y456b6bbcj6270f7ad50459da0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A problem here is that _create_hash_desc is called many times to
create a TupleDesc with int32 attribute.
I've tried to implement the function like this ,
TupleDesc _create_hash_desc()
{
static bool firstcall = true;
static TupleDesc tupdesc;
if(firstcall){
tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc, 1, "hashcode", INT4OID, -1, 0);
}
firstcall = false;
return tupdesc;
}

but it failed because tupdesc is free later, IMHO.
Any advice?

--
Best Regards,
Xiao Meng

DKERC, Harbin Institute of Technology, China
Gtalk: mx(dot)cogito(at)gmail(dot)com
MSN: cnEnder(at)live(dot)com
http://xiaomeng.yo2.cn

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message daveg 2008-07-16 12:37:36 Re: [PATCHES] pg_dump lock timeout
Previous Message Xiao Meng 2008-07-16 09:37:38 Re: gsoc, store hash index tuple with hash code only