View Single Post
Old 12-07-2012, 06:07 PM   PM User | #10
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I talked the oracle datalord this morning, and here's how he pretty much described it.
If you are using a VARCHAR field, then the use of ws_concat will result in the size that it has available at max.
So if you have projectname and devname, both 20 chars max for VARCHAR and assigned three devs to the project "Project1": Mary, John, Joe, this would result in 8*3 + 4 + 4 + 3 for a total of 35bytes (project name * records + each developer name). However, using ws_concat would result in 8 + 20 * 3 for a total of 68bytes (project name + 3 devs at a total of 20bytes in the varchar). This assumes a single byte charset of course. Also ignoring any standard overhead of the datatypes in question.
Now he said if you use a VARCHAR2 datatype, the ws_concat would be the sizeof the actual used chars + delimiters. So ultimately, if you use the VARCHAR type, you should make use of the multiple records instead. If you use VARCHAR2, you could use the ws_concat to group the results in the SQL.
Fou-Lu is offline   Reply With Quote