Hi, I've had a performance issue in one of my apps, and have traced it back to Dataset#columns. This method seems to remove any filtering from the dataset, and then query for the first row to get the column symbols. This is problematic, because while my filtered query takes about 2ms, my unfiltered query takes about 8sec, just to get the column names.
So here are some thoughts as to how this could be improved, and I'm really asking for problems with these methods that I haven't thought of that would make #columns return incorrect results. 1. If I've specified the columns I want returned using select(:foo, :bar.as(:baz)), then do we not *always* already know what the column names will be, (i.e. [:foo, :baz])? Even if I do an unaliased calculation/sql-function usage like :sum[:foo], is the column name not just the sql version of the calculation? 2. If I haven't specified the columns, or have a '*' somewhere, can we not get the column names from the schema? 3. If the above approaches have flaws, would it not be better to keep the filtering on the dataset, as that will presumably be faster in almost all cases? I'm happy to create a patch that uses a combination of the above approaches, as long as no-one can think of any showstoppers with them. Cheers, Roland -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
