Re: What's a reasonable maximum number for table partitions?

Поиск
Список
Период
Сортировка
От Seref Arikan
Тема Re: What's a reasonable maximum number for table partitions?
Дата
Msg-id CA+4ThdoYRu1rUXQ5O_+vo+tnYN=AOK3MCWEt+R_Xf1cttkcsqA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What's a reasonable maximum number for table partitions?  (Vick Khera <vivek@khera.org>)
Список pgsql-general
Ah, I should have thought that it would be simple. Thanks a lot Vick. 

Regards
Seref


On Fri, Feb 13, 2015 at 4:54 PM, Vick Khera <vivek@khera.org> wrote:
On Fri, Feb 13, 2015 at 11:29 AM, Seref Arikan <serefarikan@kurumsalteknoloji.com> wrote:
Hi Bill, 
Could you point at some resource(s) that discuss inserting directly into the partition? Would it be possible to read directly from the partition as well? 

When preparing your SQL statement, you just specify the partition directly like this. Here's a snippet from my code in perl.

my $msg_recipients_modulo = 100; # number of partitions

sub msg_recipients_part($) {
 use integer;
 my $id = shift;
 my $part = $id % $msg_recipients_modulo;
 return 'msg_recipients_' . sprintf('%02d',$part);
}

then in when generating sql you do

$table =  msg_recipients_part($msg_id);
$sql = "SELECT FROM $table WHERE ..."

or something similar for insert/update.



В списке pgsql-general по дате отправления:

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: What's a reasonable maximum number for table partitions?
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Collection