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 1jDlTf-0005yB-Vq for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 08:52:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDlTc-0004Hh-Oo for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 08:52:00 +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 1jDlTc-0004Ha-BE for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 08:52:00 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jDlTX-0006d3-TS for pgsql-general@postgresql.org; Mon, 16 Mar 2020 08:51:59 +0000 Received: by mail-lj1-x230.google.com with SMTP id 19so17622522ljj.7 for ; Mon, 16 Mar 2020 01:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Afe63WIXiWdnRmKgeAV+aK7SYFflFAmId5S6nn0N/Zc=; b=NrvaVtwkXWpyG00Z5XKU8pti3uUlWX1rZXBfl+tyHOazom+tQXxoX8eoqMLsG0MZdU ZT5K0N3NwOBC3he9ld3VhE1yr5YkKViIyAi5qxyXSzrQovfHIoSi3CR4l7MMdWDHhO8b 4PtdnmUrZ1PGi5/DwcDqJOqWXRKkqlbatbAHeg8DI1jh2gq4/PQG1S/pRZIP5yXsZ4NO spLO3l/z9NBC4QiuHtGF3aHpEL/wxeUmIrjJFdmnpAC/rTnCSJdwZwFwDjC3YzYkIMKi 3cpjQok1n2gTXiPzR8PyIawdT+/mEZ18Ou9akaJIhxJTHxBBQ7lAnQjkH6tX7yYTNRKz iR7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Afe63WIXiWdnRmKgeAV+aK7SYFflFAmId5S6nn0N/Zc=; b=SGhPchV+4tSU7o+cHOlXNpGiJgS1ZdoXipG4NhyoAHAqXowQNVKbYPTf/QmaytPeX2 GqRqB+twPYYduj1FDkPwx+fXj10QsIOb6kHgN082B9kwS/lFad8Ls1Kqb9YYoY3whUlJ /W9ZrHiNk0bENjQQL03Os3JnKkISUU/z01JwK18pbBOyOX/EsvJ1LFWDw2OgTFEDrtnP Iscm3XHPaLUW2XZeEH4lw2qRxpyCAAVNXlXjGDRWj5zOdpeCdpYX2P1Ohlrsz4K0/kkE phMj1iEv7kU1kyK9kdXNE+UoItwLxoFC84P04A/uzXHP8HMe00FhoLzdBIhPpGQnht5p iZMg== X-Gm-Message-State: ANhLgQ03QgbseiCERh0FTOl0OUS/Pd6vFcxaGVBkN4Q22xMmFvghfrBh CzmqWlAvzlb3uhEPFjnGrAk= X-Google-Smtp-Source: ADFU+vvLdnTNFYtuyN9pxTD8N05Aa2ZqW+VS4auHOC0Cq3ObL0ijpVIkQqbTZxafMUF46o86SCGlxg== X-Received: by 2002:a2e:b892:: with SMTP id r18mr16133016ljp.252.1584348713015; Mon, 16 Mar 2020 01:51:53 -0700 (PDT) Received: from imac.lan (81-227-64-79-no276.tbcn.telia.com. [81.227.64.79]) by smtp.gmail.com with ESMTPSA id 133sm16149649ljj.91.2020.03.16.01.51.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2020 01:51:52 -0700 (PDT) From: =?utf-8?Q?Bj=C3=B6rn_Lundin?= Message-Id: <7D74B8B5-DFBD-4B5B-85C6-A516343E49C1@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_77F9520F-8896-474F-93E5-BEF418B98F3C" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Order by and timestamp Date: Mon, 16 Mar 2020 09:51:51 +0100 In-Reply-To: <24142.1584319263@sss.pgh.pa.us> Cc: Adrian Klaver , pgsql-general@postgresql.org To: Tom Lane References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <24142.1584319263@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_77F9520F-8896-474F-93E5-BEF418B98F3C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 16 mars 2020 kl. 01:41 skrev Tom Lane : >=20 > Adrian Klaver writes: >> On 3/15/20 2:33 PM, Bj=C3=B6rn Lundin wrote: >>> I then did =E2=80=99select * from AMARKETS order by STARTTS=E2=80=99 >=20 >> Is amarkets in more then one schema? >=20 > 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? Yes - in other schemas - described in reply to Adrain But the schema_path does not point to them And those two other tables are empty > Another possibly-useful bit of evidence is to see what EXPLAIN shows = as > the query plan for this query. bnl=3D> explain select * from amarkets order by startts; QUERY PLAN =20= ----------------------------------------------------------------------- Sort (cost=3D10702.57..10939.29 rows=3D94691 width=3D106) Sort Key: startts -> Seq Scan on amarkets (cost=3D0.00..2875.91 rows=3D94691 = width=3D106) (3 rader) -- Bj=C3=B6rn Lundin b.f.lundin@gmail.com --Apple-Mail=_77F9520F-8896-474F-93E5-BEF418B98F3C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

16 mars 2020 kl. 01:41 skrev Tom Lane <tgl@sss.pgh.pa.us>:

Adrian= Klaver <adrian.klaver@aklaver.com> writes:
On 3/15/20 2:33 PM, = Bj=C3=B6rn Lundin wrote:
I then did =E2=80=99select * from AMARKETS order by = STARTTS=E2=80=99

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?

Yes - = in other schemas - described in reply to Adrain
But the = schema_path does not point to them
And those two other tables = are empty


Another = possibly-useful bit of evidence is to see what EXPLAIN shows as
the query plan for this query.

bnl=3D> explain select * from = amarkets order by startts;
  =                     =         QUERY PLAN          =                     =  
---------------------------------------------------------------= --------
 Sort  (cost=3D10702.57..10939.29 rows=3D94691 = width=3D106)
   Sort Key: startts
   ->  Seq Scan on = amarkets  (cost=3D0.00..2875.91 rows=3D94691 = width=3D106)
(3 = rader)

--
Bj=C3=B6rn Lundin




= --Apple-Mail=_77F9520F-8896-474F-93E5-BEF418B98F3C--