In our case we are so we can use the optimized code in Listing 3. In fact this code is often 10 times faster than the brute force method and is the fastest in our round up. If it's an option, this choice is best. Well, in one sense it is true, but with a rather major caveat. The formats are quite similar, however a recordset is stored as a collection of column data and a two dimensional array as a collection of arrays.
Columns become rows and rows become columns.
Using this method each primary array index contains a column from the original query. The code simply serializes the query to WDDX, performs four simple replacements, then deserializes the resulting packet into an array. Although interesting code, and definitely the fastest way we've found to transform the rows of a query into columns, this didn't completely solve the problem we set ourselves. So this method isn't faster at all. The Results We'll end with some actual timings from all these methods.