Slow alter column

Moderator: NorbertKrupa

Post Reply
jpettyjohn
Newbie
Newbie
Posts: 2
Joined: Fri Jan 30, 2015 6:02 am

Slow alter column

Post by jpettyjohn » Thu Oct 29, 2015 2:23 am

I am trying to change a long varchar into a varchar(1024) - the largest value currently is 187 characters long but may go beyond the 255 mark.

There are 32,652,451 but as the alter statement has now been rolling on for 6 hours I'm a little concerned. It has three projections including the super.

The machine has 12gigs of RAM and 12 cores, not heavily used otherwise.

Should I be taking any actions on this or let it stay the course?

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: Slow alter column

Post by NorbertKrupa » Thu Oct 29, 2015 2:45 am

I probably would have created a new column, used COPY to go from original to new, then dropped the original.

Have you checked if the request is still running through query_requests?
Checkout vertica.tips for more Vertica resources.

jpettyjohn
Newbie
Newbie
Posts: 2
Joined: Fri Jan 30, 2015 6:02 am

Re: Slow alter column

Post by jpettyjohn » Thu Oct 29, 2015 3:40 am

Tracking on the drop and add approach - sounds like that would have been better.

No sign of it in query_requests, but it shows up in sessions (select statement_id,session_id,client_hostname,current_statement from sessions where current_statement <> '';).

There is no statement_id in the sessions table for it so I tried killing the session - this disconnected the client which started the query but it didn't change in the sessions table and is still slamming all my CPUs.

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: Slow alter column

Post by NorbertKrupa » Thu Oct 29, 2015 6:48 pm

I'm not sure if I would let it run for that long even though it's working on long varchar's.
Checkout vertica.tips for more Vertica resources.

Post Reply

Return to “Vertica Database Administration”