Quantcast
Channel: TimescaleDB and PostgreSQL - Timescale Community Forum
Viewing all articles
Browse latest Browse all 291

Сould not find pathkey item to sort

$
0
0

Hi, all!

Postgres version: PostgreSQL 15.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
TimscaleDB version: 2.12.1
Hypertable is compressed.

If the query joins compressed hypertable with regular postgres table and period is larger then few days then exception is threw

SELECT date_trunc('day', a.date_col) AS col_date,
	a.col2,
	b.col3,
	COUNT(DISTINCT a.id_account),
	SUM(a.num_col1 - a.num_col2)
FROM compressed_hypert AS a
	INNER JOIN postgres_table AS b ON b.id = a.id
WHERE a.col_date >= TIMESTAMP '2023-10-01' AND a.col_date < TIMESTAMP '2023-11-15'
GROUP BY date_trunc('day', a.date_col), a.col2, b.col3
;

SQL Error [XX000]: ERROR: could not find pathkey item to sort

If I reduce period to few days then the query gives the result successfully.

About this I found issue on github but the decision I did not find.

Is there a workaround to do the query like above working?

Thanks in advance.

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 291

Trending Articles