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 1gjjat-0003TL-T7 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Jan 2019 11:42:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjjas-0005qr-H6 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Jan 2019 11:42:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjjas-0005qk-6x for pgsql-hackers@lists.postgresql.org; Wed, 16 Jan 2019 11:42:50 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjjao-0008K1-Jd for pgsql-hackers@postgresql.org; Wed, 16 Jan 2019 11:42:48 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 347F921D1806; Wed, 16 Jan 2019 14:42:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id ED4A121D1705; Wed, 16 Jan 2019 14:42:44 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1547638965; bh=FoGwQTW4BX+/pP/154mb1DK4YoSVn+vh/v4lpxchnqs=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=jX0847NTlXe45aLOaL2ntVbOwuYJ1sG/wqLHqVsgpd01XZ/t9lPGBUN2hSye91h5P 6flABzmcsPf/IYqjIsXX9qGctNjaDpDG4D0/uWyMGrS7e2+OFqIPeGT2pfDkpIVATt CUhbibnUp11/dcpq8JAfvaO2iQc0KYtLMN3pzgj8= Subject: Re: [PROPOSAL] Shared Ispell dictionaries To: Tomas Vondra , Robert Haas Cc: Tom Lane , Pavel Stehule , Andres Freund , pgsql-hackers References: <20180322105603.GA23544@zakirov.localdomain> <28250.1521924996@sss.pgh.pa.us> <25186.1521951490@sss.pgh.pa.us> <20180325205408.GA19457@arthur.localdomain> <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> From: Arthur Zakirov Message-ID: <337f7a55-58b8-4fcc-a933-5e7799fa6882@postgrespro.ru> Date: Wed, 16 Jan 2019 14:42:44 +0300 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: <68aaaff6-0efe-c14b-7aee-fb110bb97f69@2ndquadrant.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Tomas, On 16.01.2019 03:23, Tomas Vondra wrote: > I've looked at the patch today, and in general is seems quite solid to > me. I do have a couple of minor points > > 1) I think the comments need more work. Instead of describing all the > individual changes here, I've outlined those improvements in attached > patches (see the attached "tweaks" patches). Some of it is formatting, > minor rewording or larger changes. Some comments are rather redundant > (e.g. the one before calls to release the DSM segment). Thank you! > 2) It's not quite clear to me why we need DictInitData, which simply > combines DictPointerData and list of options. It seems as if the only > point is to pass a single parameter to the init function, but is it > worth it? Why not to get rid of DictInitData entirely and pass two > parameters instead? In the first place init method had two parameters. But in the v7 patch I added DictInitData struct instead of two parameters (list of options and DictPointerData): https://www.postgresql.org/message-id/20180319110648.GA32319%40zakirov.localdomain I haven't way to replace template's init method from init_method(internal) to init_method(internal,internal) in the upgrade script of extensions. If I'm not mistaken we need new syntax here, like ALTER TEXT SEARCH TEMPLATE. Thoughts? > 3) I find it a bit cumbersome that before each ts_dict_shmem_release > call we construct a dummy DickPointerData value. Why not to pass > individual parameters and construct the struct in the function? Agree, it may look too verbose. I'll change it. > 4) The reference to max_shared_dictionaries_size is obsolete, because > there's no such limit anymore. Yeah, I'll fix it. > /* 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. > XXX "supported" is not the same as "all ispell dicts behave like that". I'll reword the sentence. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company