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 1jDre2-0000vg-UD for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 15:27: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 1jDre1-0002JG-La for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2020 15:27:09 +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 1jDre1-0002Iz-Bh for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2020 15:27:09 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDrdz-0004ZO-5B for pgsql-general@postgresql.org; Mon, 16 Mar 2020 15:27:08 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ED8625C02E6; Mon, 16 Mar 2020 11:27:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 16 Mar 2020 11:27:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=m pHz0+mXQM8NKiqvBJR+hyhYZ9f5keH9KKRWTSlY8zs=; b=mHPGbY3tnOX1JimKa j5IEG9pSFtLfJ0AQ/Dh5mA4ZMYRhV5vBVXaLpzxlqfmSHcXkVP3bIe2qqXcOBzgy iS8RjLG7k6hM2Qv6k3MTXS/ZNgozZJSiGKq+vAQvFNwhbi0wmI3ANdHK2jim4gkg ndlhouLlDpVdj1/OMQwePY80Msf3xJWjijYMsM+n9Km5YAEXU4feb8VvWNs8N4Zp +z9NydwLWBVGvdsk7qotosjBel20TTeu77DZw/T4j7tIJ9PnpPulIS0+gwHixUW5 58byitSwWLg3dhqMeVSXzylJXR8wzWDWYeNnGIif3CG4ELIjVqHef+7k2hjq74Ha 22PZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=mpHz0+mXQM8NKiqvBJR+hyhYZ9f5keH9KKRWTSlY8 zs=; b=BKFi86zDFWoEoJjfzzHb0ixM+ZAMyld7DHGiwWi9iW5Jjxm2WUpDTtYW0 NPLHMdFUDRf63AvN7lVDJbkUAxB1GHyeA9g6CPPZVYD93mf40WNs+z1actZN6Tyi Qyt7ZuEP2EpBopyyYhDFNKuyvIwBggu2p/7U/vtVphEB7wBoDy8WXZ5J23uYjXfq yByKtZQFj6njpamAPIw2i8AYP4Rk8kj88MgHieMobH3B7yHwMcp6DC4FFGxaThtl 8RbdXx/MFBUojstokEk9fCfitZ/VwZ1ZwhCn+OTqQ1Sb3NG8D7c0JhQsJ5gOzS61 5rguTVNkvR1RQjZSzaoVhYMJT1I2w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepjedurddvuddvrdduvdelrdduleefnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklh grvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 38518328006B; Mon, 16 Mar 2020 11:27:05 -0400 (EDT) Subject: Re: Order by and timestamp To: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= , Tom Lane Cc: pgsql-general@postgresql.org References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <24142.1584319263@sss.pgh.pa.us> <7D74B8B5-DFBD-4B5B-85C6-A516343E49C1@gmail.com> From: Adrian Klaver Message-ID: Date: Mon, 16 Mar 2020 08:27:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <7D74B8B5-DFBD-4B5B-85C6-A516343E49C1@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/16/20 1:51 AM, Björn Lundin wrote: > > >> 16 mars 2020 kl. 01:41 skrev Tom Lane > >: >> >> 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? > > 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=> explain select * from amarkets order by startts; Can you run as: explain analyze select * from amarkets order by startts; >                               QUERY PLAN > ----------------------------------------------------------------------- >  Sort  (cost=10702.57..10939.29 rows=94691 width=106) >    Sort Key: startts >    ->  Seq Scan on amarkets  (cost=0.00..2875.91 rows=94691 width=106) > (3 rader) > > -- > Björn Lundin > b.f.lundin@gmail.com > > > > -- Adrian Klaver adrian.klaver@aklaver.com