From: | Francisco Olarte <folarte(at)peoplecall(dot)com> |
---|---|
To: | Олег Самойлов <splarv(at)ya(dot)ru> |
Cc: | "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Very newbie question |
Date: | 2023-10-23 17:26:31 |
Message-ID: | CA+bJJbwWE09opeVAo5-imbbPHvcnAPcf33x-07XPJv7RDq+oYA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, 23 Oct 2023 at 17:42, Олег Самойлов <splarv(at)ya(dot)ru> wrote:
> Well, get list of partitions and later scan one by one all 100 partitions is too simple. :) I am interesting is here more elegant way? Any rewriting the query, any creating an index are permitted.
1.- You do not scan all partitions. Had you not top-posted it coudl
easily be noted:
> > 1.- Get list of partitions, sort oldest first.
This means you get list of partitions, which is just a query, sorting
them, even if you have to do it client side should be trivial unless
you use really weird schemes, and you could sort them by your ranges
in the query.
Also, getting them oldest first means you evaluate the age-query
before archiving, once for each archivable partition plus one extra,
an overhead which should be dwarfed by any non-trivial archival, even
a rename or drop index would probably be longer.
And last. We have different concepts for elegance. IMO by saying a
solution is "too simple" not having stated "I want a complex tricky
solution" disqualifies you a bit. For real problems, no solution is
too simple ( it may be a language problem, or you may have hidden
constraints, but that needs to be specified ).
feel free to exec &> /dev/null.
Francisco Olarte.
From | Date | Subject | |
---|---|---|---|
Next Message | Merlin Moncure | 2023-10-23 18:27:24 | psql \r and \e -- what does clearing the query buffer actually do? |
Previous Message | Achilleas Mantzios | 2023-10-23 17:18:08 | Re: PostgreSQL inheritance vs https://wiki.postgresql.org/wiki/Don%27t_Do_This |