Sybase - This exceeds the maximum allowable limit of

2010. 11. 22. 20:11plming/DB

Select SQL 실행 시 발생한다.

Error (414) The current query would generate a key size of 648 for a work table.  This exceeds the maximum allowable limit of 600.

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_12.5.svrtsg/html/svrtsg/svrtsg192.htm

 Error 414
 Severity
 16

 Message text
 The current query would generate a key size of %d for a work table.  This exceeds the maximum allowable limit of %d.

 Explanation
 When you execute a query, Adaptive Server may need to create work tables to temporarily store query results. For example, a work table is used when duplicate rows must be removed in processing a query with an aggregate function. A sysindexes row is built for the work table after checking that the specified command does not violate any limitations on keys for user tables.

 Error 414 is raised when you execute a query containing an aggregate function, and the total length of columns named in the group by clause of the query exceeds the maximum limit of 600 bytes.

 Action
 Check the command for possible violations of the 600 byte size limit. You can correct the problem by doing one of the following:
 - Reduce the columns named in the group by clause until the combined column length is no more than 600 bytes.
 - If it is necessary to group by a large character column, consider using the substring string function on the column in the group by clause. This allows Adaptive Server to build a composite key to group the result set using only a portion of the character string. For example:
   1> select * from titles
   2> group by title, substring(notes,1,10)

   This query uses only the first 10 bytes of notes (a 200 byte varchar column) to group the data.

 Versions in which this error is raised
 All versions



문제는 group by에 기술된 column의 갯수가 많아서 그렇다.
    → group을 처리하기 위한 Key를 저장하는 공간의 기본 byte수를 초과한 것이다.

group by에 기술된 column의 갯수를 줄이면 문제는 해결된다.

'plming > DB' 카테고리의 다른 글

Sybase - Transact-SQL functions  (0) 2010.11.23
Sybase - Error 원인 & 처리방법  (0) 2010.11.22
GetDate - Sybase, MS SQL  (0) 2010.10.13
Sybase 15.0.1 vs Oracle 10.2  (0) 2010.10.13
Sybase SQL등 명령어  (0) 2010.08.26