Tuesday, 2024-02-13

*** tosky_ is now known as tosky09:48
abhishekkdansmith, will it be wise to rollback update and delete queries to not use join?14:35
dansmithabhishekk: oh sorry, I meant to go looking at options and got distracted14:36
dansmithI think we can probably use a subquery there14:36
abhishekkSo use direct plain query syntax in conn.execute?14:36
dansmithlooks like zzzeek isn't around but he can probably tell us easily14:36
dansmithno I think you can do it with sqla14:37
abhishekkok, I will look for it14:37
abhishekkif possible will update PS tomorrow this time14:38
abhishekkthank you!14:38
dansmithabhishekk: https://docs.sqlalchemy.org/en/20/tutorial/data_update.html#correlated-updates14:38
dansmithI think you can just use the subquery for the "where" part14:38
abhishekkI know the query, just need to find out how to put this in sqla 14:39
abhishekkI guess I have used subquery at one api, let me check14:39
dansmithI imagine query.filter_by(subquery) where subquery just grabs the node id14:39
abhishekkack14:40
abhishekksomething like this, https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/api.py#L1575 ?14:46
abhishekkthis method is not used anywhere now :/14:47
dansmithyeah I mean you could do raw SQL as well, but I probably wouldn't unless you can't do it any other way14:50
abhishekkUpdate cached_images set values last_accessed=?, hits=(cached_images.hits + ?) where cached_images.image_id = ? and cached_images.node_reference_id = (select node_reference_id from node_reference where node_reference.node_reference_url = ?)14:50
abhishekkI will find out how to do it using sqla14:51
dansmithdid subquery not work?14:51
abhishekkI didn't tried it yet14:52
dansmithoh okay14:52
abhishekkbut subquey will generate above query, right?14:52
dansmithyep, should be pretty much exactly that14:53
abhishekkack, thanks for the inputs14:54
dansmithnp :)14:57
abhishekksubquery doesn't work with delete, managed to get it worked with update17:15
abhishekkignore above statement17:29
dansmithheh, I was going to say... :D17:52
opendevreviewAbhishek Kekane proposed openstack/glance master: Add required database API(s) for cache  https://review.opendev.org/c/openstack/glance/+/89987018:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Introduce centralized database driver for image cache  https://review.opendev.org/c/openstack/glance/+/89987118:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Read global config file for cache utilities  https://review.opendev.org/c/openstack/glance/+/89987218:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Move sqlite code in common module  https://review.opendev.org/c/openstack/glance/+/90041818:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Migrate from SQLite to Centralized db  https://review.opendev.org/c/openstack/glance/+/90041918:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Use centralized_db cache driver in tempest jobs  https://review.opendev.org/c/openstack/glance/+/90142918:28
opendevreviewAbhishek Kekane proposed openstack/glance master: New grenade job to upgrding cache driver  https://review.opendev.org/c/openstack/glance/+/90164918:28
opendevreviewAbhishek Kekane proposed openstack/glance master: Make `centralized_db` cache driver default  https://review.opendev.org/c/openstack/glance/+/90711118:28
opendevreviewAbhishek Kekane proposed openstack/glance master: [docs] Configure centralized_db cache driver  https://review.opendev.org/c/openstack/glance/+/90824718:28
abhishekk:D hopefully sqlalchemy-tips job agrees with me18:31
abhishekkit does18:47
* abhishekk signing out18:47

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!