Re: Incremental sort for access method with ordered scan support (amcanorderbyop)

From: Miroslav Bendik <miroslav(dot)bendik(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incremental sort for access method with ordered scan support (amcanorderbyop)
Date: 2023-04-19 04:52:59
Message-ID: CAPoEpV02WhawuWnmnKet6BqU63bEu7oec0pJc=nKMtPsHMzTXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for feedback

> 2. You can use list_copy_head(root->query_pathkeys,
> list_length(orderbyclauses)); instead of:
>
> + useful_pathkeys = list_truncate(list_copy(root->query_pathkeys),
> + list_length(orderbyclauses));

This code will crash if query_pathkeys is NIL. I need either modify
list_copy_head (v3.1) or add checks before call (v3.2).

I don't know if it's a good idea to modify list_copy_head. It will add
additional overhead to every call.

--
Best regards
Miroslav

Attachment Content-Type Size
am_orderbyop_incremental_sort_v3.1.patch text/x-patch 4.7 KB
am_orderbyop_incremental_sort_v3.2.patch text/x-patch 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yurii Rashkovskii 2023-04-19 04:56:46 Re: [PATCH] Allow Postgres to pick an unused port to listen
Previous Message Stephen Frost 2023-04-19 04:21:39 Re: [PATCH] Allow Postgres to pick an unused port to listen