AWS REDSHIFT: ERROR Intermediate result row exceeds database block size

AWS REDSHIFT: ERROR Intermediate result row exceeds database block size



I inherited a freelance project. I know next to nothing about AWS and even less about Redshift. I would appreciate an



I keep getting that error when making a more complicated PostgreSQL query.


CREATE TEMP TABLE tmp_014a622dfe AS ((SELECT * FROM prod.backend2 WHERE mail = 'Yes' AND marketing IN('MEDICINE')) UNION (SELECT * FROM prod.backend2 WHERE mail = 'Yes' AND marketing IN('AGRICULTURAL')));



ERROR: Intermediate result row exceeds database block size



I googled it and it seems like it's due to a query being to 'big', this really makes no sense to me. But it's possible as the query is about 2960 chars.



Is there more to this error? How can I bypass it?



I did some research on redshift it seems to be designed for logging, this is being used for marketing; should I recommend switching to a RDS or another AWS product?






Edit your question and include the query and schema. Your error means that the intermediate row is wider than 1 MB. Modify your query to not return so much data in each row. You need to define what you mean by "marketing". You need to define what your data is, how big, how it is accessed, etc. There are times when a standard SQL server is better and there are times that products like Redshift are much better.

– John Hanley
Sep 11 '18 at 4:12






@JohnHanley I am only making a count query, I don't understand why that would be over 1mb. Sorry for my ignorance.

– Lev
Sep 11 '18 at 4:55






You query is ??? your schema is ???, how can anyone review the problem without the data.

– John Hanley
Sep 11 '18 at 4:58






I am not sure hot to get the schema but I included the query.

– Lev
Sep 11 '18 at 5:34







select * from pg_table_def where tablename = 'prod.backend2' ;

– John Hanley
Sep 11 '18 at 5:58




0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ