pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PROPOSAL] Shared Ispell dictionaries
Date: Mon, 15 Jan 2018 22:02:57 +0300
Message-ID: <20180115190104.GA2622@arthur.localdomain> (raw)
In-Reply-To: <404f06c5-c7a3-3313-1a64-25f08ba089ad@2ndquadrant.com>
References: <20171226164825.GA29922@zakirov.localdomain>
	<20171231152811.GA4233@arthur.localdomain>
	<20180107190526.GA27803@arthur.localdomain>
	<d12d9395-922c-64c9-c87d-dd0e1d31440e@2ndquadrant.com>
	<CAKNkYnzQ8SJCiFityn+4B_0zZKOmfw1R1M0KHXaFF8BYf9DJ=g@mail.gmail.com>
	<404f06c5-c7a3-3313-1a64-25f08ba089ad@2ndquadrant.com>

On Sat, Jan 13, 2018 at 10:33:14PM +0100, Tomas Vondra wrote:
> Not sure if we really need to add the database/schema OIDs. I mentioned
> the unexpected consequences (cross-db sharing) but maybe that's a
> feature we should keep (it reduces memory usage). So perhaps this should
> be another CREATE TEXT SEARCH DICTIONARY parameter, allowing sharing the
> dictionary with other databases?
> 
> Aren't we overengineering this?

Another related problem I've noticed is memory leak. When a dictionary
loaded and then dropped it won't be unloaded. I see several approaches:

1 - Use Oid of the dictionary itself as the key instead dictfile and
afffile. When the dictionary is dropped it will be easily unloaded if it
was loaded. Implementing should be easy, but the drawback is more memory consumption.
2 - Use reference counter with cross-db sharing. When the dictionary is
loaded the counter increases. If all record of loaded dictionary is dropped
it will be unloaded.
3 - Or reference counters without cross-db sharing to avoid possible confusing.
Here dictfile, afffile and database Oid will be used as the key.

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company




view thread (108+ messages)  latest in thread

Message-ID: <20180115190104.GA2622@arthur.localdomain>
Permalink:  ../20180115190104.GA2622@arthur.localdomain/
Also on:    postgresql.org/message-id/20180115190104.GA2622@arthur.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.zakirov@postgrespro.ru, tomas.vondra@2ndquadrant.com
  Subject: Re: [PROPOSAL] Shared Ispell dictionaries
  In-Reply-To: <20180115190104.GA2622@arthur.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox