Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTtsK-0008Qf-2c for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Dec 2017 18:22:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTtsJ-0001Fe-AI for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Dec 2017 18:22:51 +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.84_2) (envelope-from ) id 1eTtsI-0001FC-TJ for pgsql-hackers@lists.postgresql.org; Tue, 26 Dec 2017 18:22:51 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eTtsB-0003FZ-3R for pgsql-hackers@postgresql.org; Tue, 26 Dec 2017 18:22:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 1B22021C1C2C; Tue, 26 Dec 2017 21:22:40 +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 arthur.localdomain (unknown [94.29.3.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id DA60F21C05E4; Tue, 26 Dec 2017 21:22:39 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1514312559; bh=8SGbRpJH9RBq03lK1yDW+buNtudV34WhXnNd8SAswp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=aItA4aznOHLa1xKcQV8AHG3U3D3WC63DExcUEoMBc/G1he+eaRDjSefzkJxrr1Acm iAuoMFhOQETBC+a7ngHmXBxbwIXWfBEmQdThz96brIrGKrzppH/y7E7R1ssQf3j8Rn 82MV+cXMPorZXZTAJq//Gq+JCaApYklMRhv5YI6Q= Date: Tue, 26 Dec 2017 21:22:38 +0300 From: Arthur Zakirov To: Alvaro Herrera Cc: pgsql-hackers Subject: Re: [PROPOSAL] Shared Ispell dictionaries Message-ID: <20171226182237.GA1291@arthur.localdomain> References: <20171226164825.GA29922@zakirov.localdomain> <20171226165557.w2zd3tdlr6gqq33b@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171226165557.w2zd3tdlr6gqq33b@alvherre.pgsql> User-Agent: Mutt/1.9.2 (2017-12-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you for your feedback. On Tue, Dec 26, 2017 at 01:55:57PM -0300, Alvaro Herrera wrote: > So what are you going to use instead? For example, AffixNode and AffixNodeData represent prefix tree of an affix list. They are accessed by Suffix and Prefix pointers of IspellDict struct now. Instead all affix nodes should be placed into an array and accessed by an offset. Suffix array goes first, Prefix array goes after. AffixNodeData will access to a child node by an offset too. AffixNodeData struct has the array of pointers to AFFIX struct. These array with all AFFIX data can be stored within AffixNodeData. Or AffixNodeData can have an array of indexes to a single AFFIX array, which stored within IspellDict before or after Suffix and Prefix. Same for prefix tree of a word list, represented by SPNode struct. It might by stored as an array after the Prefix array. AffixData and CompoundAffix arrays go after them. To allocate IspellDict in this case it is necessary to calculate needed memory size. I think arrays mentioned above will be built first then memcpy'ed into IspellDict, if it won't take much time. Hope it makes sense and is reasonable. > > So this will be a large patch not submitted to 2018-01? Depending on > size/complexity I'm not sure it's OK to submit 2018-03 only -- it may be > too late. > Oh, I see. I try to prepare the patch while 2018-01 is open. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company