slow sql server DB reads

bart smap at scarlet.be
Mon May 23 17:15:03 EDT 2005


I run a python website on a IIS server. I replaced my flat file DB
with SQL server, but the reads are very slow. 7 seconds for 3 querrys
like these

conn= adodbapi.connect( "Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Password=xxx;Initial Catalog=dlpl;Data
Source=(local)" )
        crsr = conn.cursor() 
        sql = "select SessionKey, SessionValue from ASPSessionState
where GUID='%s'" % self.id
        crsr.execute(sql)
        while 1: 
            info = crsr.fetchone() 
            if not info: 
                break 
            strKey = str(info[0])

Opening the database is already good for 2 seconds. 
Anyone know how to speed it up?



More information about the Python-list mailing list