Re: slow sql server DB reads
- From: Larry Bates <lbates@xxxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 07:52:43 -0500
If GUID is not a key in the database make it one. That
way you won't have to do serial reads through the entire
table to locate matching entries.
It is hard to be more specific because we don't know how
many records are in ASPSessionState table. If there are
only a few, the problem is probably elsewhere. If there
are many, indexing on GUID would provide speed improvement.
Larry Bates
bart wrote:
> 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?
.
- References:
- slow sql server DB reads
- From: bart
- slow sql server DB reads
- Prev by Date: Re: searching substrings with interpositions
- Next by Date: Re: Terminating a thread from the parent
- Previous by thread: slow sql server DB reads
- Next by thread: ClientForm question
- Index(es):
Relevant Pages
|