On Jul 19, 2010, at 4:38 PM, thatsanicehatyouh...@mac.com wrote:

> 
> On Jul 19, 2010, at 4:08 PM, Michael Bayer wrote:
> 
>> so its going to be doing that somewhat inefficient "isinstance(list)" thing 
>> you see below, this appears to be how it handles arrays of arbitrary numbers 
>> of dimensions. This could be optimized if the ARRAY type accepted some clues 
>> as to how many dimensions are present.
> 
> There is a function in postgresql called "array_dims" that returns the array 
> dimensions - could this be of some use? It could query the database 
> dynamically to get the number of values.

I'd just have you say ARRAY(dims=4)




> 
>> Seems a little suspicious that the slowdown would be 8000% though.
> 
> We have four columns in that table of type numeric[]. So that query returns 
> 1000 rows x 4 numeric[] columns of 4634 values in each array. (I work with 
> Adrian.)

so try this type:

class ARRAY(postgresql.ARRAY):
    def bind_processor(self, dialect):
        return None

    def result_processor(self, dialect, coltype):
        return None

that will just give you the raw psycopg2 data.



> 
> Cheers,
> Demitri
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to