Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGQ3H-0001NN-Cs for pgsql-hackers@arkaria.postgresql.org; Wed, 09 May 2018 14:26:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGQ3G-0000W1-75 for pgsql-hackers@arkaria.postgresql.org; Wed, 09 May 2018 14:26:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGQ3F-0000Vo-O8 for pgsql-hackers@lists.postgresql.org; Wed, 09 May 2018 14:26:42 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGQ3C-0004v5-2e for pgsql-hackers@lists.postgresql.org; Wed, 09 May 2018 14:26:40 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 0935321C1F23; Wed, 9 May 2018 17:26:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from ars-thinkpad (nat03-43-2.netorn.net [188.35.130.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id D42B121C1EE2; Wed, 9 May 2018 17:26:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1525875994; bh=KNtm6f2k/3HShN7J4cIxbWAyEUeuGpmyqkFdVmb6DKc=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=TbfZxJimc2WMKqp/i9O5P9D+zcOQKvjhVROpsNBfNQmGHmmjre58+UC0y5ZEP09Hv TmOGOtzrfwV95ec3yJQqsugESTIMkI7r2uhVcmHLlNTkEf2QCyR2LvRhfOvecboXky vemd/KEtkvoMfWvq1j2uWohQZEm78zZao0Ejjhxk= References: <87sh71cakz.fsf@ars-thinkpad> User-agent: mu4e 1.1.0; emacs 26.0.50 From: Arseny Sher To: Simon Riggs Cc: Arseny Sher , "pgsql-hackers\@lists.postgresql.org" Subject: Re: Indexes on partitioned tables and foreign partitions In-reply-to: Date: Wed, 09 May 2018 17:26:34 +0300 Message-ID: <87r2mkdhwl.fsf@ars-thinkpad> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Simon Riggs writes: > How much sense is it to have a partitioned table with a mix of local > and foreign tables? Well, as much sense as fdw-based sharding has, for instance. It is arguable, but it exists. > Shouldn't the fix be to allow creation of indexes on foreign tables? > (Maybe they would be virtual or foreign indexes??) Similar ideas were discussed at [1]. There was no wide consensus of even what problems such feature would solve. Since currently indexes on foreign tables are just forbidden, it seems to me that the best what partitioning code can do today is just not creating them. [1] https://www.postgresql.org/message-id/flat/4F62FD69.2060007%40lab.ntt.co.jp#4F62FD69.2060007@lab.ntt.co.jp -- Arseny Sher Postgres Professional: http://www.postgrespro.com The Russian Postgres Company