Re: Issue related with patitioned table:How can I quickly determinewhich child table my record is in,given a specific primary key value?

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: Issue related with patitioned table:How can I quickly determinewhich child table my record is in,given a specific primary key value?
Дата
Msg-id CAKoxK+64bLMR8nuMyrRwjvQD90o4e=LVNgEMysy16btuwmhXKg@mail.gmail.com
обсуждение исходный текст
Ответ на Issue related with patitioned table:How can I quickly determine which child table my record is in,given a specific primary key value?  ("王旭" <wangxu@gu360.com>)
Ответы Re: Issue related with patitioned table:How can I quickly determine which child table my record is in,given a specific primary key value?  ("James(王旭)" <wangxu@gu360.com>)
Список pgsql-general
On Wed, Jul 17, 2019 at 9:19 AM 王旭 <wangxu@gu360.com> wrote:
> I tried something like this:  e.g., for symbol_id 6365,
> SELECT (hashint2(6365::SMALLINT)% 10)

shouldn't this be modulus 3 instead of 10?
The problem is that record 6365 is not where you expected to be?

As far as I know, there is no easy user-level way to get the route to
a table, but you can juggle with the expression that defined each
table and make a good guess.
However, your query should give a good idea:

# SELECT 'my_table_' || (hashint2(6365::smallint)% 3);
  ?column?
------------
 my_table_2



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

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: How to run a task continuously in the background
Следующее
От: "James(王旭)"
Дата:
Сообщение: Re: Issue related with patitioned table:How can I quickly determine which child table my record is in,given a specific primary key value?