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 1exj2k-0006cj-NN for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Mar 2018 00:52:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1exj2i-0002bt-Hh for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Mar 2018 00:52:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1exj2i-0002bj-AL for pgsql-hackers@lists.postgresql.org; Mon, 19 Mar 2018 00:52:52 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1exj2e-0005lF-8x for pgsql-hackers@postgresql.org; Mon, 19 Mar 2018 00:52:51 +0000 Received: by mail-wm0-x234.google.com with SMTP id n3so12503454wmd.1 for ; Sun, 18 Mar 2018 17:52:47 -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=ljhnO4+UkBRYX2dn6WABv/i9qZCZpvfyQTTEgnEoaic=; b=sxWC88Ds+VwGL1pDu5L/Xqx/9dTxl0wXARMXAmuV2eVE3JH5gcPAwmLx3qZNjSEckK mQJScTPhfBN23ZEuaYlwtKw1fK687YyJN1rup42aZ9s9+K1W195guvsjrv+cgNSdLH1J 15No5fA7fmNbaDm92GMuZJgb/UQuCHJZ4IGS5zuiPjo/iiAGrnjrNtnGBAkFccJRrLh0 QItEi5fQm5HNN6MfFv8QopKRh9TLh2s+vumWECE72b8jprFeWwj1KQuByjLCDyJDJwoF zD46dDpXKrgJWzf9D0mGdxHTKTOH6dnqgCc4Egk5v7Kpn/Y/IxcI/Y4UoY2zKuBqzi9a OiQg== 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=ljhnO4+UkBRYX2dn6WABv/i9qZCZpvfyQTTEgnEoaic=; b=U6tT69vmcml3TcqP7npImfOwoV+f0/xamrHQ/N/VYdUgAj9qXSFmS67WI7ogmDoSvR I4VivhKUTX4DQ6T3VQkEGHFyWcIZYYF74O0ky9V0ZdED71/q70cSxZbbCs5Kx9zJ3d1z c6NMqIe5sbbmfG57gb2CsgMOHY0qYCeXBM2IcMLQKtq5EonIHR3wjDNKSPwuKVSV/N/F 9O/XMkWEFnmszZ2gx47MDROBjHlFA3Pl8NqjnKaPfrMfZzWgS8Wst82CHGnO8SKRAVqo H5KY6IqkMCxUGW9oLgHOgqi3Mx+M3PiCcThvOQi3QOinHvp3ixgiFykKLoXJd2TCq0y9 41Tw== X-Gm-Message-State: AElRT7F7X9kmLoza/KK+uXHbNig+VsfRI2ZLdakO2WkMICQ5KR0llRxa 7fIhivTn2kPxgdqtmfhpR1udfOmiqlA9T1fFiliohAdVTMzA9WOespKYgIDpOlMao/Gfxw0F54a HHwDOGYI9dqrGlmL00Ni2t8fiPftudM4Dwp4BpryFGAaAOURTSvZkjQ9ayK5j25SLTss0g0R9BG yQs+vaPvkp X-Google-Smtp-Source: AG47ELvGLdiL3XRO+g0auyv17nreV63bTQ2vQe7X/EYmtwdFqrkO7mQXjR+bj46z/ixfKBlhd5akIw== X-Received: by 10.28.64.131 with SMTP id n125mr6748027wma.140.1521420766328; Sun, 18 Mar 2018 17:52:46 -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 u127sm15599662wmd.30.2018.03.18.17.52.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Mar 2018 17:52:45 -0700 (PDT) Subject: Re: [PROPOSAL] Shared Ispell dictionaries To: Arthur Zakirov Cc: Pavel Stehule , Andres Freund , Ildus Kurbangaliev , pgsql-hackers References: <20180302043149.tn2xjgt2vcigknhe@alap3.anarazel.de> <20180307085553.GA5126@zakirov.localdomain> <3195b6e6-4026-d7e2-ffa9-3780bc3cca6f@2ndquadrant.com> <20180307115528.GA10093@zakirov.localdomain> <20180307124353.GA12054@zakirov.localdomain> <20180307125847.GA12617@zakirov.localdomain> <20180307131819.GA13301@zakirov.localdomain> <3c7910ba-2a1b-5b73-71c6-d037ba1e89bd@2ndquadrant.com> From: Tomas Vondra Message-ID: Date: Mon, 19 Mar 2018 01:52:41 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/17/2018 05:43 AM, Arthur Zakirov wrote: > Hello Tomas, > > Arthur, what are your plans with this patch in the current CF? > > > I think dsm-based approach is in good shape already and works nice. > I've planned only to improve the documentation a little. Also it seems I > should change 0004 part, I found that extension upgrade scripts may be > made in wrong way. > In my opinion RELOAD and UNLOAD commands can be made in next commitfest > (2018-09). > Did you look it? Have you arguments about how shared memory allocation > and releasing functions are made? >   > > > It does not seem to be moving towards RFC very much, and reworking the > patch to use mmap() seems like a quite significant change late in the > CF. Which means it's likely to cause the patch get get bumped to the > next CF (2018-09). > > > Agree. I have a draft version for mmap-based approach which works in > platforms with mmap. In Windows it is necessary to use another API > (CreateFileMapping, etc). But this approach requires more work on > handling processed dictionary files (how name them, when remove). >   > > > FWIW I am not quite sure if the mmap() approach is better than what was > implemented by the patch. I'm not sure how exactly will it behave under > memory pressure (AFAIK it goes through page cache, which means random > parts of dictionaries might get evicted) or how well is it supported on > various platforms (say, Windows). > > > Yes, as I wrote mmap-based approach requires more work. The only > benefit I see is that you don't need to process a dictionary after > server restart. I'd vote for dsm-based approach. > I do agree with that. We have a working well-understood dsm-based solution, addressing the goals initially explained in this thread. I don't see a reason to stall this patch based on a mere assumption that the mmap-based approach might be magically better in some unknown aspects. It might be, but we may as well leave that as a future work. 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). In any case, I suggest to polish the dsm-based patch, and see if we can get that one into PG11. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services