Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Dec 18, 2024

We weren't pruning table columns when there was a distinct clause over the projections, this resulted the deserialization of every column, even if they weren't going to make it to the result. This is bad for performance, especially if the unread columns are of TEXT, LONGTEXT, 'BLOB, LONGBLOB` type as those are stored out of band, and take longer to deserialize.

fixes: dolthub/dolt#8689

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we have associated tests for the anti join change?

if rt, ok := ta.Child.(*plan.ResolvedTable); ok {
if t := rt.UnderlyingTable(); t != nil {
if pt, ok := t.(sql.ProjectedTable); ok {
tmpTbl := pt.WithProjections(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sql.PrimaryKeyTable is how we do this in other places, i'm pretty sure the memo RelProps has this already

@jycor jycor merged commit 701e962 into main Dec 19, 2024
8 checks passed
@jycor jycor deleted the james/distinct branch December 19, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prune columns from select distinct

3 participants