How to check product variant on_hold is correct in database?


I have a question linked to the inventory.
I would like to be sure that the on_hold field in product_variant entity is correct in my database.
Does this query do the job ? can I trust it ?
I would like to know if I don’t miss some filters.

select, sum(oi.quantity) as booked_quantity, spv.on_hold
from sylius_order_item as oi
join sylius_order so on oi.order_id =
join sylius_product_variant spv on oi.variant_id =
where so.state = "new"
and so.payment_state = "awaiting_payment"
group by;

Thank you.