Will drop a partition affect ongoing queries?
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?
Best Answer
-
Bryan_H Vertica Employee Administrator
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
0