Efficient map looking table - Mailing list pgsql-general

From Yoann MOREAU
Subject Efficient map looking table
Date
Msg-id 20120110224432.55686vbzcct9c85c@webmail.univ-avignon.fr
Whole thread Raw
Responses Re: Efficient map looking table  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
Hello, I store in a database some XML-tag data. I have one table for
the tag names with an int PK for each unique name (tag_names) and one
table for the tags (tags) where each row references a tag name. The
tag_names table is not big but the tags table is huge. When I insert a
row in tags I have to check if its tag name already exists to get its
id_tag_name and if not insert it in tag_names.

My question : is there an efficient way to check/get the tag_name,
it's doing the same job as a hashmap. I need it to be up to date in
the database when inserting new tag names, because different inserts
in tags table could occur at the same time, all checking for a tag
name. I then would need the whole tag_names table to be loaded in
memory and in the most "map" way as possible, is there anything
special to do ?

Thanks !
Yoann Moreau

pgsql-general by date:

Previous
From: Filip Rembiałkowski
Date:
Subject: Re: string = any()
Next
From: "David Johnston"
Date:
Subject: Re: string = any()