DISTINCT

17 views
Skip to first unread message

pantonis

unread,
Jun 27, 2023, 2:58:25 AM6/27/23
to MariaDB ColumnStore
We have the requirement for Pivoting on our UI since this is one of the key concepts of OLAP. To do this we need to get unique values of a table column and we use SELECT DISTINCT(col)....

This causes issues to large tables.
Any other alternative way to achieve this?

Faisal Saeed

unread,
Jun 27, 2023, 8:36:46 AM6/27/23
to pantonis, MariaDB ColumnStore
Hey there, I would try GROUP BY, It’s much more efficient.

SELECT COL1, … FROM … GROUP BY COL1;


--
You received this message because you are subscribed to the Google Groups "MariaDB ColumnStore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mariadb-columns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mariadb-columnstore/a3243bb3-ad06-49d8-a517-c4e21207cd29n%40googlegroups.com.

Roland Noland

unread,
Jun 27, 2023, 8:48:33 AM6/27/23
to pantonis, MariaDB ColumnStore
Hi,

I would use Faisal's suggestion with the currently available MCS.
JFYI We are re-factoring DISTINCT[1] so it will leverage GROUP BY internally.

Regards,
Roman


вт, 27 июн. 2023 г. в 09:58, pantonis <anton...@gmail.com>:
We have the requirement for Pivoting on our UI since this is one of the key concepts of OLAP. To do this we need to get unique values of a table column and we use SELECT DISTINCT(col)....

This causes issues to large tables.
Any other alternative way to achieve this?

pantonis

unread,
Jul 10, 2023, 3:16:49 AM7/10/23
to MariaDB ColumnStore
Thank you
Reply all
Reply to author
Forward
0 new messages