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 1gzXmD-0000zu-FN for pgsql-general@arkaria.postgresql.org; Fri, 01 Mar 2019 02:19:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzXmC-00017b-41 for pgsql-general@arkaria.postgresql.org; Fri, 01 Mar 2019 02:19:52 +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 1gzXmB-00015P-KD for pgsql-general@lists.postgresql.org; Fri, 01 Mar 2019 02:19:51 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzXm9-0003Nt-4r for pgsql-general@lists.postgresql.org; Fri, 01 Mar 2019 02:19:50 +0000 Received: by mail-ot1-x331.google.com with SMTP id i5so19626014oto.9 for ; Thu, 28 Feb 2019 18:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=mElrKuCPy3N23blv64aKa0jTZY9H9Oy0k+UDZZ7tqfY=; b=cysvXINtP+aSBlVyqd5Axb4SLI7wBVCCQwgBaRiZm5mDPWtN71ze6qMPKIMk76UA6h XdDMgOKsjHWVxMsRwix3tSx1zvj/FLw8lxh/amKCjwZv0adblHhvVLuRgruYnl8Z8GDD qJYXybG0Y76FruHszgWLCu+FSvfFI7oQpMkQZ2jxEluD269OgcVDTC9NgAWyZWO2kuP5 FMxVswR08MTNMGRg+51Il/plg0Hc0lSP+7QRbM2bWFLDdshtI6StOdfMW8Ky0nZfLK4J /mNU7pSFskqGGIC1sBMyw0iqQ0dH2DOHz30a2KpbU8/BkWNDbbqdvxRiVxPt4BFuMJgR 2pIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=mElrKuCPy3N23blv64aKa0jTZY9H9Oy0k+UDZZ7tqfY=; b=m5leHQc3YpSDUCHkHAdkKvVAtoOYBqZlt7sWJi9Cj5v9qvqsi1yws2u8LYMbnESZjV 5wR7thRPSNhqaU5hhDroNQSHMXpMEUJ9trkqI1CihFWkO1zKqyYCI3ZxlmkG68O0g7FM 1Lc6qDmx7IcwD3YaqX4T+0mpjiyv4PHNazAkZH542ACwks+zpmdwx7AWBYIa9iRcZTFX Hwyp7YTtRsWcS/RD4gRMoMVY4s1CH2zY07lPTHtR/H9icyWdaKOL5UangNQKLZJdFYS3 P1LqGd2PmBLCDWccHwgC8YQ2naeMdfsuEzkSNYyblpf4n4NoJ/Bl3HSzpuP3/B2EUcSr uQCQ== X-Gm-Message-State: APjAAAXhgBEXgPhZS95/JGKB9EBY2PL6X5HgGRsFBYbq3Sv3wkvY0PsA 2MN675G41UdOFrt1UKfX36N59jF/ X-Google-Smtp-Source: APXvYqxmJ/id9EvODKPbwTPnVOzltz2vRgPluNeueRwhjUE0+w/i+9ieqNVlfjt1fj+XWma8ZkGSeg== X-Received: by 2002:a9d:6845:: with SMTP id c5mr1924087oto.350.1551406787806; Thu, 28 Feb 2019 18:19:47 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id e24sm8455909otl.2.2019.02.28.18.19.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 18:19:47 -0800 (PST) Subject: Re: Overloaded && operator from intarray module prevents index usage. To: PostgreSQL General References: <10517.1551372290@sss.pgh.pa.us> <1650.1551393260@sss.pgh.pa.us> <4364c5c4-da6f-a532-8a9b-c5f2a80b0882@gmail.com> From: Ron Message-ID: <16afa0dd-5520-34bd-0ea5-bedc8e2096cb@gmail.com> Date: Thu, 28 Feb 2019 20:19:46 -0600 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: Content-Type: multipart/alternative; boundary="------------28215FE854D541CA1F49291E" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------28215FE854D541CA1F49291E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 2/28/19 7:53 PM, Michael Lewis wrote: > > > On Thu, Feb 28, 2019 at 4:57 PM Ron > wrote: > > On 2/28/19 4:53 PM, Michael Lewis wrote: > [snip] >> Would a sixth option be to re-create the column as array type > > Codd is spinning in his grave... > > > I'd hope he would be fine with people asking questions to learn. I'm open > to studying any suggested resources. I also love to learn from those with > experience who are further down this path, just as I love to share my > experience with people who don't from a WHERE from a HAVING. If there is > anything specific you can point me to, please do chime in with something > constructive. Michael, E. F. Codd developed the relational model, and Normal Forms to structure the attributes (columns), tuples (rows) and relations (tables).  They work to prevent insert, update and delete anomalies. Quoting him in /The Relational Model for Database Management Version 2/ from 1990: "values in the domains on which each relation is defined are required to be atomic with respect to the DBMS." Arrays are -- by definition -- not atomic, and so they fundamentally break the model that relational databases are founded upon.  If you want to be a good database designer, don't use arrays. (Darwen and Date deconstruct "atomic value" into meaninglessness by claiming that, for example, strings are arrays of characters and thus arrays are ok.  I think that's bollocks.) -- Angular momentum makes the world go 'round. --------------28215FE854D541CA1F49291E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 2/28/19 7:53 PM, Michael Lewis wrote:


On Thu, Feb 28, 2019 at 4:57 PM Ron <ronljohnsonjr@gmail.com> wrote:
On 2/28/19 4:53 PM, Michael Lewis wrote:
[snip]
Would a sixth option be to re-create the column as array type

Codd is spinning in his grave...

I'd hope he would be fine with people asking questions to learn. I'm open to studying any suggested resources. I also love to learn from those with experience who are further down this path, just as I love to share my experience with people who don't from a WHERE from a HAVING. If there is anything specific you can point me to, please do chime in with something constructive.

Michael,

E. F. Codd developed the relational model, and Normal Forms to structure the attributes (columns), tuples (rows) and relations (tables).  They work to prevent insert, update and delete anomalies.

Quoting him in The Relational Model for Database Management Version 2 from 1990: "values in the domains on which each relation is defined are required to be atomic with respect to the DBMS."

Arrays are -- by definition -- not atomic, and so they fundamentally break the model that relational databases are founded upon.  If you want to be a good database designer, don't use arrays.

(Darwen and Date deconstruct "atomic value" into meaninglessness by claiming that, for example, strings are arrays of characters and thus arrays are ok.  I think that's bollocks.)

--
Angular momentum makes the world go 'round.
--------------28215FE854D541CA1F49291E--