mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
Make generate_queries_for_path_pattern_recurse() interruptible
In case of a very long path pattern with each element pattern being resolved to many graph elements generate_queries_for_path_pattern_recurse() may take very long time to generate all the possible graph paths. Make generate_queries_for_path_pattern_recurse() interruptible so that a user may be able to cancel such a query if required and the interrupts are processed in timely manner. Author: Satyanarayana Narlapuram <satyanarlapuram@gmail.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAHg%2BQDfDwcM4%3DDSiAV6Ly89YQ5EcMhzO1-9x%3DmGG1WJzODcAig%40mail.gmail.com
This commit is contained in:
@@ -367,6 +367,8 @@ generate_queries_for_path_pattern_recurse(RangeTblEntry *rte, List *pathqueries,
|
|||||||
|
|
||||||
foreach_ptr(struct path_element, pe, path_elems)
|
foreach_ptr(struct path_element, pe, path_elems)
|
||||||
{
|
{
|
||||||
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|
||||||
/* Update current path being built with current element. */
|
/* Update current path being built with current element. */
|
||||||
cur_path = lappend(cur_path, pe);
|
cur_path = lappend(cur_path, pe);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user