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 1jc0Rq-0007o3-Am for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 05:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jc0Rp-0004e5-7u for pgsql-general@arkaria.postgresql.org; Fri, 22 May 2020 05:42:21 +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 1jc0RI-00079y-Bu for pgsql-general@lists.postgresql.org; Fri, 22 May 2020 05:41:48 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc0RG-0007wW-8y for pgsql-general@postgresql.org; Fri, 22 May 2020 05:41:47 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id CAC771C71; Fri, 22 May 2020 08:41:44 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S7Jm8JOJPIiN; Fri, 22 May 2020 08:41:42 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost1.estpak.ee [213.180.2.79]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 940761C7A; Fri, 22 May 2020 08:41:42 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost1.estpak.ee (Postfix) with ESMTPSA id 49SwN33LYgz1y1; Fri, 22 May 2020 08:41:38 +0300 (EEST) Message-ID: <355991B0CB3940CCBF2E176348EE42BD@dell2> From: "Andrus" To: "Tom Lane" , "David G. Johnston" Cc: "Adrian Klaver" , "pgsql-general" References: <2B1267647FD14565B73801AF12CA1A88@dell2> <17696.1590101245@sss.pgh.pa.us> <7736da96-5b03-d334-1be5-e593fc54d40b@aklaver.com> <19749.1590104161@sss.pgh.pa.us> In-Reply-To: <19749.1590104161@sss.pgh.pa.us> Subject: Re: Query returns no rows in pg_basebackup cluster Date: Fri, 22 May 2020 08:40:51 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! >> The LIKE query probably doesn't use an index and thus finds the relevant >> data via sequential scan and equality checks on each record. >Yeah, exactly. An equality condition will use a btree index if >available. LIKE, however, sees the "_" as a wildcard so it cannot >use an index and resorts to a seqscan --- which will work fine. >It's just index searches (and index-based sorts) that are broken. >Of course, if there isn't an index on the column in question >then this theory falls to the ground. There is composite index on baas column CREATE TABLE public.desktop ( id integer NOT NULL DEFAULT nextval('desktop_id_seq'::regclass), recordtype character(5) COLLATE pg_catalog."default" NOT NULL, klass character(1) COLLATE pg_catalog."default", baas character(8) COLLATE pg_catalog."default" NOT NULL, liigid character(1) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar, jrk numeric(4,0) NOT NULL DEFAULT 0, ... CONSTRAINT desktop_pkey PRIMARY KEY (id), CONSTRAINT desktop_baas_not_empty CHECK (baas <> ''::bpchar), CONSTRAINT desktop_id_check CHECK (id > 0), CONSTRAINT desktop_recordtype_check CHECK (recordtype = 'Aken'::bpchar OR recordtype = 'Veerg'::bpchar) ) TABLESPACE pg_default; CREATE INDEX desktop_baas_liigid_idx ON public.desktop USING btree (baas COLLATE pg_catalog."default" ASC NULLS LAST, liigid COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default; Maybe it is possible to force postgres in windows to use the same locale as in Linux. Locales are actually the same. Andrus.