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

Add query statistics support #215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MikhailNazarov
Copy link
Contributor

Pull request type

  • Feature

Other information

there are two tests:

  • test_stats_updates
  • test_stats_reads

first failed because no table access stats, second failed because it show two phases: update and read (?) when i send only second query with stats collection

@rekby rekby self-requested a review December 6, 2024 09:08


let mut tx = client.table_client().create_interactive_transaction();
let res = tx.query(Query::new(
Copy link
Member

Choose a reason for hiding this comment

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

YDB may delay some operations, for example all changes delay up to end of transation if no need result of the update (for example read the table). Try check statistic on commit or try read same table - for force apply upsert


println!("{:?}", res.stats);

assert_eq!(2, res.stats.map(|x|x.rows_affected()).unwrap_or(0));
Copy link
Member

Choose a reason for hiding this comment

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

The reason same as above: upsert delay apply until ydb need it. In the case - up to the select. And upsert really apply only on when you send select.

You can select twice: upsert will be applied for first select and you will see only reads for second select.

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.

2 participants