metabase / metabase

The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
https://metabase.com
Other
38.04k stars 5.05k forks source link

MLv2 Schema for order by should have a no-duplicates constraint #39384

Closed camsaul closed 1 week ago

camsaul commented 6 months ago

It doesn't make sense to include the same expression multiple times in an order by,

ORDER BY x DESC, y ASC, x DESC

is at best no different from

ORDER BY x DESC, y ASC

and possibly affecting performance if the DB doesn't optimize it out.

The old legacy MBQL schema has a constraint to disallow duplicates, but the MLv2 schema seems to be missing it.

We need to make sure that this ignores lib UUIDs

This should be safe to add without affecting existing queries because the legacy schema would have disallowed it

DShivansh commented 5 months ago

Hi @camsaul I am trying to learn Clojure and Metabase looks like a good project to me, being very new to the project can you please assist me in identifying the appropriate starting point to delve into the project in order to effectively address the current issue.

paoliniluis commented 5 months ago

@DShivansh I would strongly suggest you take another issue as a starting point, this one is super advanced

DShivansh commented 5 months ago

@paoliniluis do you have any beginner friendly issue in mind that I can start looking into?