Redshift Order BY LIMIT being ignored from query

0

Hi all, I faced an strange scenario in a simple query on Redshift and i'm trying to understand if this is a bug or normal (i dont think so) behavior:

My query (for example only):

SELECT * FROM table WHERE id = 'UUID' ORDER BY date DESC LIMIT 1

This query, for some unknown reason are returning all records matching with WHERE clause but discarding order by and limit clauses. Even on "explain" from query editor it is not being considered.

However if change the query to something like this:

SELECT * FROM table WHERE id LIKE 'UUID' ORDER BY date DESC LIMIT 1

Basically changing the operator "=" per "LIKE" in WHERE clause my query works fine, the response returns only a specified limited records ordered correctly. Some hints: this strange behavior only happened in my tests when the parameter in WHERE clause is a string DistKey with UUID content

Mimo
질문됨 일 년 전240회 조회
1개 답변
0

I could not replicate this behavior on my table. Could it be something very specific to your table and your data? Maybe best to open a support ticket and see what they find.

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인