Fwd: Declarative partitioning and partition pruning/check

Поиск
Список
Период
Сортировка
От Mats Taraldsvik
Тема Fwd: Declarative partitioning and partition pruning/check
Дата
Msg-id CAGs3qpTiKV_8PogNt3yofMCLWHN4kt_DrpmhJzQ47DZj-_DksQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fwd: Declarative partitioning and partition pruning/check (+postgis)  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
I'm re-trying this email here, as there were no answers in the psql-general list. Hope that's ok. (please cc me when answering as I'm not subscribed (yet) )

Hi,

I have tried to read about Oracle's spatial partitioning feature (https://www.oracle.com/technetwork/database/enterprise-edition/spatial-twp-partitioningbp-10gr2-05-134277.pdf) and wondered if something like this is possible with PostgreSQL (with PostGIS):

The first part, getting the rows into the "right" partition isn't especially interesting: Reduce every geometry to a point, and use the x and y coordinates separately in a range partition. This is possible with PostgreSQL as it is a normal range partition on double.

The second part is more interesting. Whenever the spatial index is (implicitly or directly) used in a query, the partition pruning step (during execution) checks the spatial index's root bounding box to determine if the partition can be skipped.

Is this possible to achieve in PostgreSQL? There is already a function in PostGIS to get the spatial index root bounding box (_postgis_index_extent(tbl regclass, col text)), but I think the real issue is that the actual SQL query might not even call the index directly (SELECT * FROM a WHERE ST_Intersects(mygeom, a.geom) - the ST_Intersects function uses the index internally).

Best Regards,
Mats Taraldsvik

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Patch a potential memory leak in describeOneTableDetails()
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: TRAP: FailedAssertion("tabstat->trans == trans", File: "pgstat_relation.c", Line: 508