Long query in Amazon Redshift never return

I am facing a weird problem when running long queries in Amazon Redshift (>30min). Such queries do not provide feedback upon completion, even though they are completed when looking through the Redshift console or querying the stv tables.

We tested this in SQL Workbench/J, which uses the JDBC driver and a Node.js application using a Javascript-only driver. In all cases, queries keep going forever and never complete, not even with an error.


You can try to add ?tcpKeepAlive=true at the end of the connection string. I find it helpful in some long running queries.

The same goes for other TCP keep alive settings for your operating system.

For example, for Mac:

sudo sysctl -w net.inet.tcp.always_keepalive=1

You would probably also want to optimize your queries not to take too long time. There are many options for that, depends on your actual queries. But a quick improvement you can get with the new SSD based nodes: http://aws.amazon.com/about-aws/whats-new/2014/01/23/amazon-redshift-ssd-node-type/

I suppose you have a problem with connection timing out.

If your query should return some rows (SELECT), maybe try to UNLOAD result into S3 bucket?

TO 's3://some_bucket/some/path/to/files'
WITH CREDENTIALS AS 'aws_access_credentials'

Keep in mind, that this will create multiple files (at least one per node) and you will have to merge them into one.

Need Your Help

ffmpeg and php to get an image out of a video and convert video to ogg

php video ffmpeg

I have a video hosting site and have successfully installed ffmpeg on my local server. Things work overall, but I cannot get the video duration and don't know how to convert videos to the ogg forma...

Running karma after installation results in 'karma' is not recognized as an internal or external command

node.js terminal karma-runner

I'm trying to run karma as part as an angular-seed project, after installing karma using