Skip to content

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