Re: Very newbie question

2023-10-26 Thread Peter J. Holzer
On 2023-10-26 11:56:56 +0200, Olivier Gautherot wrote: > El jue, 26 oct 2023 11:15, Peter J. Holzer escribió: > On 2023-10-25 17:48:46 +0200, Olivier Gautherot wrote: > > El mié, 25 oct 2023 16:58, Олег Самойлов escribió: > >     Okey, I see no one was be able to solve this problem. B

Re: Very newbie question

2023-10-26 Thread Olivier Gautherot
Hi, El jue, 26 oct 2023 11:15, Peter J. Holzer escribió: > On 2023-10-25 17:48:46 +0200, Olivier Gautherot wrote: > > El mié, 25 oct 2023 16:58, Олег Самойлов escribió: > > Okey, I see no one was be able to solve this problem. But I could. > May be > > for someone this will be useful to

Re: Very newbie question

2023-10-26 Thread Peter J. Holzer
On 2023-10-25 17:48:46 +0200, Olivier Gautherot wrote: > El mié, 25 oct 2023 16:58, Олег Самойлов escribió: > Okey, I see no one was be able to solve this problem. But I could. May be > for someone this will be useful too. There is solution. [...] > Now query is: > > SELECT genera

Re: Very newbie question

2023-10-25 Thread Olivier Gautherot
Hi, El mié, 25 oct 2023 16:58, Олег Самойлов escribió: > Okey, I see no one was be able to solve this problem. But I could. May be > for someone this will be useful too. There is solution. > > Original query was: > > > 23 окт. 2023 г., в 18:13, Олег Самойлов написал(а): > > > > SELECT id/10

Re: Very newbie question

2023-10-25 Thread Олег Самойлов
Okey, I see no one was be able to solve this problem. But I could. May be for someone this will be useful too. There is solution. Original query was: > 23 окт. 2023 г., в 18:13, Олег Самойлов написал(а): > > SELECT id/1000 as partition > FROM delivery > GROUP BY partition > HAVING ma

Re: Very newbie question

2023-10-23 Thread Francisco Olarte
On Mon, 23 Oct 2023 at 17:42, Олег Самойлов 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 y

Re: Very newbie question

2023-10-23 Thread Ron
On 10/23/23 10:13, Олег Самойлов wrote: Back pardon, but I have a very newbie question. I have a partitioned table, partitioned by primary bigint key, size of partition 1000. I need to get the number of partition which need to archive, which has all rows are olden then 3 month. Here is

Re: Very newbie question

2023-10-23 Thread Олег Самойлов
nor ORDER BY > clause. > > Toomas > >> On 23. Oct 2023, at 18:13, Олег Самойлов wrote: >> >> Back pardon, but I have a very newbie question. I have a partitioned table, >> partitioned by primary bigint key, size of partition 1000. I need to get >> th

Re: Very newbie question

2023-10-23 Thread Олег Самойлов
023 at 17:14, Олег Самойлов wrote: >> Back pardon, but I have a very newbie question. I have a partitioned table, >> partitioned by primary bigint key, size of partition 1000. I need to get >> the number of partition which need to archive, which has all rows are olden

Re: Very newbie question

2023-10-23 Thread Francisco Olarte
On Mon, 23 Oct 2023 at 17:14, Олег Самойлов wrote: > Back pardon, but I have a very newbie question. I have a partitioned table, > partitioned by primary bigint key, size of partition 1000. I need to get > the number of partition which need to archive, which has all rows are olden

Re: Very newbie question

2023-10-23 Thread Toomas
There is no reason to use index. The query has neither WHERE nor ORDER BY clause. Toomas > On 23. Oct 2023, at 18:13, Олег Самойлов wrote: > > Back pardon, but I have a very newbie question. I have a partitioned table, > partitioned by primary bigint key, size of partition 1000

Very newbie question

2023-10-23 Thread Олег Самойлов
Back pardon, but I have a very newbie question. I have a partitioned table, partitioned by primary bigint key, size of partition 1000. I need to get the number of partition which need to archive, which has all rows are olden then 3 month. Here is query: SELECT id/1000 as partition