How to delete tables from ds2.xLarge cluster type ?

0

Hi,

We have recently changed the cluster node type from dc2.8xLarge to ds2.xLarge to reduce our daily usage cost.

Now as mentioned in this documentation "https://docs.aws.amazon.com/redshift/latest/mgmt/query-editor.html", ds2.xLarge cluster type does not supports querying, so how are we supposed to access our schema ? This is required because we need to delete some tables.

Kindly suggest.

asked 4 years ago256 views
6 Answers
0

Hi TiwaryShashwat,

The only thing that is not support is the query editor in the Redshift console. You only need to chose either a JDBC or ODBC SQL client, add a the appropriate driver to it and configure a connection to the Redshift cluster. My personal favorite SQL client is the JDBC based DBeaver client (http://dbeaver.com).

With an established connection from any JDBC or ODBC SQL client you should be able to run any SQL statement that Redshift supports, including an DROP TABLE <table_name> statements you may require to delete table you want to get rid of.

I hope this helps you get a SQL client working with your resized cluster.
-Kurt

klarson
answered 4 years ago
0

Thanks Kurt!

DBeaver is a paid tool. I was looking for something free, so that I do not have to pay over and above the redshift cost.

I came across an aws documentation where SQL Workbench/J is suggested (and also psql). I could not get the connection done on psql so I installed SQL Workbench/J

answered 4 years ago
0

Hi Kurt,

I was trying to delete a table from redshift using SQL Workbench/J. The table has 1281542 rows.

Normally, when we were using dc2.8xLarge type node, the delete command from the console took few seconds only to execute. However deleting table from SQL Workbench/J is has taken 55 minutes execution as of now while I am writing this and it is still not deleted (Screenshot attached).

To confirm this I went to Amazon Redshift > Queries and loads to check what is happening. In the SQL column is see queries like fetch 200 in "SQL_CUR3"; and fetch 200 in "SQL_CUR4";

Can I get an explanation for what is happening here ? How am I supposed to delete a table if it is taking this much time ?

PS: select statements for the tables are executing fine.

Edited by: TiwaryShashwat on Feb 14, 2020 12:43 PM
(Added attachments)

answered 4 years ago
0

Hi TiwaryShashwat,

Regarding DBeaver, the Enterprise Edition is paid commercial product that has evolved from the original open source project that is now the DBeaver Community Edition that is free open source and always will be. You can follow the links for the Community Edition in from the dbeaver.com website or to save the effort of navigating yourself you just directly visit dbeaver.io.

Regards,
-Kurt

klarson
answered 4 years ago
0

Hi TiwaryShashwat,

I can't speak to what any other SQL client will or will not try to do with the SQL you enter into it. However, it's probably appropriate to ask you to show exactly what SQL you are entering into the SQL Workbench/J when you're trying "delete table". I suspect there is some semantic different between how I'm interpreting your words and what you're trying to do that involved either using a SQL DELETE... to delete some or all rows in a table or a SQL DROP TABLE... statement to eliminate an table entirely. I say this because a neither of those 2 statements should have any need for the SQL client to wrap either a DELETE or DROP statement in a cursor as evidenced by what you're seeing on the Redshift server side. Also, have you verified that the cursor is actually coming from your statement from your Redshift session and not from a session from another SQL client?

FWIW, I am a Redshift customer like yourself just trying to help other customers. I do not work for AWS. So please don't expect other Redshift customers to provide you a full customer support experience. There are AWS employees that also contribute to these forums too. Customers should and mostly do have different expectations from them. You can identify them by a little AWS logo next to the user names on their posts.

Regards,
-Kurt

klarson
answered 4 years ago
0

Hi All,

SQL Workbench/J is one of the supported tools form amazon redshift. Coming to delete command the working prciniple of the delete is same on every other node type.

I suspect there is a locking issue on the table which you are trying to drop hence the high execution time.

Coming to the console the alter command are not logged, so the "cursor queries" you are referring to belongs to some other tool/query.

Please open up a support case and share the time and query details to help you further accordingly.

Regards,
Kalyan

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions