Skip to main content
Question

Will drop a partition affect ongoing queries?

  • November 17, 2022
  • 1 reply
  • 3 views

jiahe1224
Forum|alt.badge.img+1

My goal is to query the latest partitioned data, let's assume,
In the first second, load new data
In the 3rd second, there is a query, assuming the query takes 5 seconds
In the 5th second, the new data loading is completed, and then the old partition is dropped

Will the ongoing query be affected when the old partition is dropped in the last step? Is it so that the drop will not be performed until the query is complete?

1 reply

Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • November 17, 2022

SELECT statement takes Shared (S) lock on the table while running. DROP_PARTITION requires higher level Owner (O) exclusive non-shared lock to drop partition so it must wait for S lock to release first. So the running query will not be affected. Please see for mor details: https://www.vertica.com/docs/12.0.x/HTML/Content/Authoring/AdministratorsGuide/Locks/LockExamples.htm