Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6ATG-0008Kj-7z for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jun 2022 12:37:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o6ATE-00084b-Sl for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jun 2022 12:37:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6ATE-00084S-E4 for pgsql-hackers@lists.postgresql.org; Tue, 28 Jun 2022 12:37:32 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o6AT7-0003ph-PC for pgsql-hackers@lists.postgresql.org; Tue, 28 Jun 2022 12:37:31 +0000 Received: by mail-oi1-x22e.google.com with SMTP id u189so17027399oib.4 for ; Tue, 28 Jun 2022 05:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C7AIqz3CHZRdGbO48mHJCC62wdC9jWgBlvXeR1PrC0k=; b=VbOD2iTn9A3w9f7YudttZc0kCgCDxD1FceTOIdjfk+VO8i0FRl9OjxNYl5Mjwm9GV1 KVZvP+u5i3av5hDIJlHQPEB2dO1nG96HxIgmiQ5niMxfj5yGkHa6CO5ijmGJ0B9P4jOT m33h/ODwNjhKo3PHIMlPzZDfLpj4ghYKqyxFYEjQv74tnSQzlmhzoK4RxzuoKgrOl6/e Ddb8ZETXnL52RyjZNRr226inpNlnx+yDRcpzrY6uOiaYSI4gwe33Y+UiN62CthhogxlI 2JGbOftjO0EbY5LAzWsFpngdg/UBL1xDQesV9l7WJHk8Os+6vAuA8snDSek9lYTMXHmG V+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C7AIqz3CHZRdGbO48mHJCC62wdC9jWgBlvXeR1PrC0k=; b=U7VVJ7Luyv7pgb7Kwex6LGQyb4xYsbfbvPRos8pehyw2dqxea9ffBBaBu93SDpmiuV 8MMeGS/6k36Kd9hUt9qnP49uhOpm+R7tWTn3GdF7XdMF7Urs1kmmAQGJrU6l72k+PDuo mALW62m+sGMJrwLYlFUSl39r9LvuQtQjsFcjIx4z+m4oNLhH6C6ptmspMmjnVw/M2pgb rt772ftBLiTFc4sF7QcwiqbbzmtheVaH9slFbE+OYCBWKDCBV+NJg66Nawql7olIY6I1 T5BYpgJyl63t3o/afMXh4Qvko6+trovR9O3cGsc77A75fbsWEMYxSQzfMmRUMBXLisR4 iIdQ== X-Gm-Message-State: AJIora9z5ooYiIxiiGHzGCM7X3va7UDIP8vWEQ9677LJM4o42hWkPTCO hHAxKSDHnyQm7qCaiffB4oQEOpkFP8UtHFUB11xNWinM6jjW0IhQ X-Google-Smtp-Source: AGRyM1v3XqYvB8kwDXq0moJSGXbJTR7wcFK1mPDL8PFZofDOBX3KwPyhOF8IBM8a3knPSraPeYtVB6hoGM7skCclj98= X-Received: by 2002:a05:6808:e8b:b0:322:4c21:6ba3 with SMTP id k11-20020a0568080e8b00b003224c216ba3mr13425584oil.204.1656419845114; Tue, 28 Jun 2022 05:37:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aleksander Alekseev Date: Tue, 28 Jun 2022 15:37:14 +0300 Message-ID: Subject: Re: [PATCH] Compression dictionaries for JSONB To: PostgreSQL Hackers Cc: Jacob Champion , Simon Riggs , Alvaro Herrera , Matthias van de Meent Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Simon, Many thanks for your feedback! I'm going to submit an updated version of the patch in a bit. I just wanted to reply to some of your questions / comments. > Dictionaries have no versioning. [...] > Does the order of entries in the dictionary allow us to express a priority? i.e. to allow Huffman coding. [...] This is something we discussed in the RFC thread. I got an impression that the consensus was reached: 1. To simply use 32-bit codes in the compressed documents, instead of 16-bit ones as it was done in ZSON; 2. Not to use any sort of variable-length coding; 3. Not to use dictionary versions. New codes can be added to the existing dictionaries by executing ALTER TYPE mydict ADD ENTRY. (This also may answer your comment regarding a limit on SQL statement size.) 4. The compression scheme can be altered in the future if needed. Every compressed document stores algorithm_version (1 byte). Does this plan of action sound OK to you? At this point it is not too difficult to make design changes. -- Best regards, Aleksander Alekseev