-
Notifications
You must be signed in to change notification settings - Fork 999
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
Manage the statistics target for a deployment #4092
Conversation
0637ce0
to
36a3bcf
Compare
store/postgres/src/relational.rs
Outdated
impl Borrow<str> for SqlName { | ||
fn borrow(&self) -> &str { | ||
self.as_str() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to implement Borrow<str>
for SqlName
, only for &SqlName
.
impl Borrow<str> for SqlName { | |
fn borrow(&self) -> &str { | |
self.as_str() | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Taking that out.
let columns = if columns.is_empty() { | ||
vec!["id".to_string(), "block_range".to_string()] | ||
} else { | ||
columns | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
- Should
id
andblock_range
always be included? - What about
vid
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen vid
be useful here, that's why I left it out. And I felt that not adding to a list of user-provided columns is more understandable than always adding them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I just left a few questions, but everything looks fine.
36a3bcf
to
9435720
Compare
Show, set or reset the target for a deployment. The statistics target determines how much of a table Postgres will sample when it analyzes a table. This can be particularly beneficial when Postgres chooses suboptimal query plans for some queries. Increasing the target will make analyzing tables take longer and will require more space in Postgres' internal statistics storage.
See also https://www.postgresql.org/docs/15/planner-stats.html#id-1.5.13.5.3