Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1exvDT-0005bd-4z for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Mar 2018 13:52:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1exvDR-0001zm-Q5 for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Mar 2018 13:52:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1exvDR-0001zb-AC for pgsql-hackers@lists.postgresql.org; Mon, 19 Mar 2018 13:52:45 +0000 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1exvDN-0007Te-L1 for pgsql-hackers@postgresql.org; Mon, 19 Mar 2018 13:52:43 +0000 Received: by mail-wr0-x236.google.com with SMTP id z12so18725148wrg.4 for ; Mon, 19 Mar 2018 06:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CDD3gfBBbNmM1LMKX73iXLstJWOOHUJ5N12E+QeFq1U=; b=jKp0PTGe4lGaaILN9x/KSfaYtOq7tmq93G2owru8r4DE7r5qeWwS4ejn64lxvydstP HEVhVennUxccDpQlCFCH7gA5iRrzlieVwhI0plY4LOalOzMmA/+Zdmk7t3SFD6EDoIoX xQ0aHp8I7PtYmSSsXX65FQFfNcUNO270UJTWj2w/EkmcZh1AcHaDPwru55FrIKFHQyJj IvAJU5inJdMVquPuZ4chm2IfjKJEf2epRfxpn4vEhDopvi32AlfEvJ237zCHKNSrkgkH BOB6W+QthohMYdrjo3rKfGGJbBD3GTQatAWAga4YZ/4tXszjzts8JMwLtoD7e4xylf2y bTFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CDD3gfBBbNmM1LMKX73iXLstJWOOHUJ5N12E+QeFq1U=; b=o9V9U1JG7HuMjcxZt3bhFdxSzJQ6Bn76eSxcQW581in+2xm90PlLF56pIAxV8ECwL3 kulCDl+ElsKb7w2gcur6qob7+bT/ZpxlDQZoztLezc8AI7EeL1A5LEYgW4m3eZyXR2BS q+q1TEYWy3pb0X8dRJ9midRkdpZg0PyFBGHpzGQ1KCvWs5JLluKHpngspvggBPwXCOks tPxtCVwjCHDgb4dMQ1MLIpT9Cf4fIE2lD77ycxYPdxjT85rFhoTTBD4y4aGxbj65vR68 1YORecapbAWORIzTA0xqZk/B2iYdMhh5mNre1n0z0XL94Utk5X8a4jj+ithctmME7P0r RT/g== X-Gm-Message-State: AElRT7G93OiFyDg2UUKzgasfCvhOM26GKSV5o/p3bjdZXWZukR47k6lO IDXsneaYFCvHISU9NCeyt58Pk8zeTsgkeY4l/qw6LjbvoJb5vB2RyP9fM6WBHgwQI9ru31zbMWF 7/M2EtPm1Db5JWRoJyN3m3Mt80ZQn+PEeseEQy9SqxHs99FYyfdFfKw+ccp0H8Ei27D83UoyaBb nY9CYrl9TY X-Google-Smtp-Source: AG47ELtjfTeHLHr+aFRIAjI78KfPy8DAlK/28TUZ8UQWbYC4CvtTVXlYIGaAHYRX9PFqo68L5pCaMA== X-Received: by 10.223.176.98 with SMTP id g31mr9256403wra.256.1521467558253; Mon, 19 Mar 2018 06:52:38 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id v124sm507414wme.27.2018.03.19.06.52.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Mar 2018 06:52:37 -0700 (PDT) Subject: Re: [PROPOSAL] Shared Ispell dictionaries To: Andres Freund Cc: Arthur Zakirov , Pavel Stehule , Ildus Kurbangaliev , pgsql-hackers References: <20180307124353.GA12054@zakirov.localdomain> <20180307125847.GA12617@zakirov.localdomain> <20180307131819.GA13301@zakirov.localdomain> <3c7910ba-2a1b-5b73-71c6-d037ba1e89bd@2ndquadrant.com> <20180319013438.s7jf3kwwwy6m7hqk@alap3.anarazel.de> From: Tomas Vondra Message-ID: <9c27384d-4538-15be-0e94-0a67a52e7b0b@2ndquadrant.com> Date: Mon, 19 Mar 2018 14:52:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180319013438.s7jf3kwwwy6m7hqk@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/19/2018 02:34 AM, Andres Freund wrote: > Hi, > > On 2018-03-19 01:52:41 +0100, Tomas Vondra wrote: >> I do agree with that. We have a working well-understood dsm-based >> solution, addressing the goals initially explained in this thread. > > Well, it's also awkward and manual to use. I do think that's > something we've to pay attention to. > Awkward in what sense? I don't think the manual aspect is an issue. Currently we have no way to reload the dictionary, except for restarting all the backends. I don't see that as a particularly convenient solution. Also, this is pretty much how the shared_ispell extension works, although you might argue that was more due to the limitation of how shared memory could be used in extensions before DSM was introduced. In any case, I've never heard complaints about this aspect of the extension. There are about two things that might be automated - reloading of dictionaries and evicting them when hitting the memory limit. I have tried to implement that in the shared_ispell dictionary but it's a bit more complicated than it looks. For example, it seems obvious to reload the dictionary when the file timestamp changes. But in fact there are three files - dict, affixes, stopwords. So will you reload when a single file changes? All of them? Keep in mind that the new version of dictionary may use different affixes, so a reload at the wrong moment may result in broken result. > >> I wonder how much of this patch would be affected by the switch >> from dsm to mmap? I guess the memory limit would get mostly >> irrelevant (mmap would rely on the OS to page the memory in/out >> depending on memory pressure), and so would the UNLOAD/RELOAD >> commands (because each backend would do it's own mmap). > > Those seem fairly major. > I'm not sure I'd say those are major. And you might also see the lack of these capabilities as negative points for the mmap approach. So, I'm not at all convinced the mmap approach is actually better than the dsm one. And I believe that if we come up with a good way to automate some of the tasks, I don't see why would that be possible in the mmap and not dsm. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services