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.92) (envelope-from ) id 1jDdod-0001Yk-O8 for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 00:41:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDdoc-00005u-8r for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 00:41:10 +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 1jDdob-00005n-Vc for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 00:41:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDdoZ-0005jn-P4 for pgsql-general@postgresql.org; Mon, 16 Mar 2020 00:41:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02G0f32T024143; Sun, 15 Mar 2020 20:41:03 -0400 From: Tom Lane To: Adrian Klaver cc: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= , pgsql-general@postgresql.org Subject: Re: Order by and timestamp In-reply-to: References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> Comments: In-reply-to Adrian Klaver message dated "Sun, 15 Mar 2020 17:37:07 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <24141.1584319263.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 15 Mar 2020 20:41:03 -0400 Message-ID: <24142.1584319263@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver writes: > On 3/15/20 2:33 PM, Björn Lundin wrote: >> I then did ’select * from AMARKETS order by STARTTS’ > Is amarkets in more then one schema? Yeah, it's hard to think of any explanation other than "the query used a corrupt index on startts to produce the ordering". But your \d doesn't show any index on startts. So maybe there's more than one amarkets table? Another possibly-useful bit of evidence is to see what EXPLAIN shows as the query plan for this query. regards, tom lane