Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glMlB-0005c7-Qp for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 23:44:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glMlA-0000Zn-74 for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Jan 2019 23:44:12 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1glMl9-0000Zg-SW for pgsql-hackers@lists.postgresql.org; Sun, 20 Jan 2019 23:44:12 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glMl2-00032j-KL for pgsql-hackers@postgresql.org; Sun, 20 Jan 2019 23:44:11 +0000 Received: by mail-wr1-x442.google.com with SMTP id p4so21286796wrt.7 for ; Sun, 20 Jan 2019 15:44:04 -0800 (PST) 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=+hJ+CRmMVfsC7wtEW4BzScsXYDJLPq/7lFC34YPY4D0=; b=Y8SJt3As9p37igP15fyU4sjUljbIzZTslPPmA4wRcjRp1cxZRdNqTjbHDd5UvrMrFh 8qz0ysFKhKhpQF3af4PBv73hTOXjVNKkp0uYRYLYBNXruXglSAZngJpIv8xLOivgM72E BYTFxBtugDcyuclvUcY006/dIEZicPOKS/KPmWBbl8QP2sXLJQuwi6dCav0l39C7cExM U67LBJRW8XcR0Gekgx0rkIj/b5mLaaRdwoKsPXWqNRmk4XuuSIbcO+jHvYDFJ+GEwV7f 1VKI9+xJTp8du0wa95TdLBhb1fdM5l1lCwgmHr9q4HTaEA2KCetI7l59PRdGwt/4f7jP K+vw== 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=+hJ+CRmMVfsC7wtEW4BzScsXYDJLPq/7lFC34YPY4D0=; b=J9iupdOTF36a4dycO9Bp7QZOfcCgBP81IR+HRj7wiaScW7VwI7l5J74Gh6G/n2OYjM LMxm0CqYCD/dnxMyJLcM5/mvnLcA85994mithzOvuVWTawingHS7EoU1CNG1HcW6fekp jRC4/BMQW9VT50unt1kjTWHZPipHBEWcVWKw9IumCeZAufmRNJ8R4olZwFv6/JRKFNuQ HsANirQ330CD/dW5/K6QjBJjcVfiuRhASN5bEFiumHzPIiMKd3/QfKBqlP5bZt31nPTh AY331lGMPtb0d8Y3sNfhxegizw4b5H+JqnatLR0rg8dpOcg75z6Jl3SQbRsNARyg1q6X WKsA== X-Gm-Message-State: AJcUukcBBnE7N8xZSkQ08jWiMCkrRbu2+wj0ZVamQp/ZQvLrXF/qSzMP DIszUFhlgBFaKCX+QMb/cb8z/6HFAvY6LQOCCUdOfQeEyrvVUO/ToUt3sv6DIgEe6WGS05zZjM4 hDRVtcVFqtz7lPNKvs8izci0nnVaNbGSyax4IxBQTZsMoAPfVr9poiJIf/Dw44WLnytqP7dY1Hk c+uHC0PFKE7KE= X-Google-Smtp-Source: ALg8bN7X5fbP31taMawN6xY7BMC6nelZAQ93qce36TgDCJ/rQVbt6HrSN3IEcWI+9bbgbw//LMifww== X-Received: by 2002:adf:b6a1:: with SMTP id j33mr25471640wre.55.1548027842230; Sun, 20 Jan 2019 15:44:02 -0800 (PST) Received: from [10.137.2.19] (ip-86-49-251-50.net.upcbroadband.cz. [86.49.251.50]) by smtp.gmail.com with ESMTPSA id j3sm47810907wmb.39.2019.01.20.15.44.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 15:44:01 -0800 (PST) Subject: Re: [PROPOSAL] Shared Ispell dictionaries To: Andres Freund Cc: Arthur Zakirov , Robert Haas , Tom Lane , Pavel Stehule , pgsql-hackers References: <27296.1522078068@sss.pgh.pa.us> <20180327121954.GA12726@zakirov.localdomain> <20180516113631.GA29544@zakirov.localdomain> <20180614084015.GA12451@zakirov.localdomain> <20181001092204.GA5071@zakirov.localdomain> <68aaaff6-0efe-c14b-7aee-fb110bb97f69@2ndquadrant.com> <337f7a55-58b8-4fcc-a933-5e7799fa6882@postgrespro.ru> <42b1ded6-fd44-5975-77e4-72ada1f134a2@2ndquadrant.com> <20190120222121.ehistvcr4wsu2su5@alap3.anarazel.de> From: Tomas Vondra Message-ID: <95aea959-97a1-2ded-c881-eede4e5a1f0c@2ndquadrant.com> Date: Mon, 21 Jan 2019 00:43:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190120222121.ehistvcr4wsu2su5@alap3.anarazel.de> 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 1/20/19 11:21 PM, Andres Freund wrote: > On 2019-01-20 23:15:35 +0100, Tomas Vondra wrote: >> On 1/17/19 3:15 PM, Arthur Zakirov wrote: >>> I attached files of new version of the patch, I applied your tweaks. >>> >>>> XXX All dictionaries, but only when there's invalid dictionary? >>> >>> I've made a little optimization. I introduced hashvalue into >>> TSDictionaryCacheEntry. Now released only DSM of altered or dropped >>> dictionaries. >>> >>>>   > /* XXX not really a pointer, so the name is misleading */ >>>> >>>> I think we don't need DictPointerData struct anymore, because only >>>> ts_dict_shmem_release function needs it (see comments above) and we only >>>> need it to hash search. I'll move all fields of DictPointerData to >>>> TsearchDictKey struct. >>> >>> I was wrong, DictInitData also needs DictPointerData. I didn't remove >>> DictPointerData, I renamed it to DictEntryData. Hope that it is a more >>> appropriate name. >>> >> >> Thanks. I've reviewed v17 today and I haven't discovered any new issues >> so far. If everything goes fine and no one protests, I plan to get it >> committed over the next week or so. > > There doesn't seem to be any docs about what's needed to be able to take > advantage of shared dicts, and how to prevent them from permanently > taking up a significant share of memory. > Yeah, those are good points. I agree the comments might be clearer, but essentially ispell dictionaries are shared and everything else is not. As for the memory consumption / unloading dicts - I agree that's something we need to address. There used to be a way to specify memory limit and ability to unload dictionaries explicitly, but both features have been ditched. The assumption was that UNLOAD would be introduced later, but that does not seem to have happened. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services