Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Query state additions #1852

Closed
5 tasks done
derekjn opened this issue Aug 13, 2017 · 7 comments
Closed
5 tasks done

Remove Query state additions #1852

derekjn opened this issue Aug 13, 2017 · 7 comments
Milestone

Comments

@derekjn
Copy link
Contributor

derekjn commented Aug 13, 2017

  • Query->cqId
  • Query->isContinuous
  • Query->swStepFactor
  • Query->isCombineLookup
  • Query->isCombine
@derekjn derekjn added this to the 0.9.9 milestone Aug 13, 2017
@derekjn
Copy link
Contributor Author

derekjn commented Aug 14, 2017

The queryId attached to Query and PlannedStmt should actually work pretty well for anything here. We can just assign an ID to them that we can use as a lookup key for any additional state attached to these objects.

@usmanm
Copy link
Collaborator

usmanm commented Aug 14, 2017

I've also seen extensions "extend" structs like:

typedef struct {
  Query query;
  int x;
  int y;
} ContinuousQuery;

That might be simpler? In our code, we just assume that a Query * is actually a ContinuousQuery *.

@derekjn
Copy link
Contributor Author

derekjn commented Aug 14, 2017

That approach feels brittle to me within the context of the planner/analyzer, as it's at the mercy of the unverifiable assumption that the pointer is never repalloc'd anywhere within these deep and complex code paths (including by other extensions!). Using embedded structs works well for significantly simpler code paths though, such as with custom scan states.

This is really what the queryId attached to Query and PlannedStmt are designed for, so I feel like we should leverage the design when such facilities are cleanly available to us.

@usmanm
Copy link
Collaborator

usmanm commented Aug 14, 2017

That makes sense to me! 9.6 also has some faster and lighter implementation of hash tables.

@derekjn
Copy link
Contributor Author

derekjn commented Aug 14, 2017

That makes sense to me! 9.6 also has some faster and lighter implementation of hash tables.

Good lord, finally!

@usmanm
Copy link
Collaborator

usmanm commented Aug 14, 2017

I'll try and find that. I remember seeing in months ago.

@usmanm
Copy link
Collaborator

usmanm commented Aug 15, 2017

Not sure if this was it: https://www.postgresql.org/message-id/[email protected]

@derekjn derekjn closed this as completed Aug 16, 2017
derekjn added a commit that referenced this issue Aug 16, 2017
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

No branches or pull requests

2 participants