Re: Select on partitioned table is very slow

Поиск
Список
Период
Сортировка
От Jose Osinde
Тема Re: Select on partitioned table is very slow
Дата
Msg-id CACg3g4DxhLdgQR2E-cHvo+-CBq3bLqJkxmCJ3_puFg7GWLbaPQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Select on partitioned table is very slow  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Select on partitioned table is very slow  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-performance

Dear Depesz, Laurenz,

Thanks very much for the fast responses. They are actually correct and saved me a lot of time. I couldn't test the cast from the Java test but this is something I can deal with later on (most probably updating the column types to text in the database side instead). But what I could do was reproduce the same problem in the psql console using the cast in the other way. This sentence:

explain analyze select logical_identifier, version_id, lastproduct
    FROM test_product_ui_partition.product_ui pui
    WHERE pui.mission_id='urn:esa:psa:context:investigation:mission.em16'::citext
    AND pui.logical_identifier='urn:esa:psa:em16_tgo_frd:data_raw:frd_raw_sc_n_20220729t000000-20220729t235959'::citext;

Creates an output equivalent to that returned from the JAVA application and reproduces the exact same problems: Scans all the partitions instead of select the right one and uses sec scans for all the cases.
Attached the result.

Again, many thanks for your help,
Jose Osinde

Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Select on partitioned table is very slow
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Select on partitioned table is very slow