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 1hGcjp-0001dG-RT for pgsql-admin@arkaria.postgresql.org; Wed, 17 Apr 2019 05:04:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGcjo-0000WL-Hf for pgsql-admin@arkaria.postgresql.org; Wed, 17 Apr 2019 05:04:00 +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 1hGcjo-0000V0-7a for pgsql-admin@lists.postgresql.org; Wed, 17 Apr 2019 05:04:00 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGcjl-0002OJ-Hk for pgsql-admin@postgresql.org; Wed, 17 Apr 2019 05:03:59 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2DD37A1072; Wed, 17 Apr 2019 07:03:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id iJubijiVdDDn; Wed, 17 Apr 2019 07:03:51 +0200 (CEST) Message-ID: Subject: Re: Performance killed with FDW when using CAST. From: Laurenz Albe To: Jorge Torralba , pgsql-admin@postgresql.org Date: Wed, 17 Apr 2019 07:03:50 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jorge Torralba wrote: > We setup a FDW server for a large table that has an hstore data type as on eof the coums. > > When we run the query directly on the FDW server > > select * from recent_events where account_id = 1 AND (attributes -> 'account_incident_id')::integer = 2617116 limit 10; > > The response is 2ms . which is awesome. > > When we run it from the remote server where we have the server defined, the query never returns. > > Our server definition is as follows. > > (host 'fdwserver', dbname 'mydb', port '5432', fetch_size '1000', use_remote_estimate 'true', extensions 'hstore') After debugging into this, it seems that the hstore operator -> cannot be pushed down because of collation problems. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com