sqlite single transaction without foreign key or triggers
aahz at pythoncraft.com
Wed May 13 03:46:27 CEST 2009
In article <Xns9C09513903E8FrtwfreenetREMOVEcouk at 22.214.171.124>,
Rob Williscroft <rtw at freenet.co.uk> wrote:
>Aahz wrote in news:guao50$1jv$1 at panix3.panix.com in comp.lang.python:
>> In article <Xns9C08E179B66D8rtwfreenetREMOVEcouk at 126.96.36.199>,
>> Rob Williscroft <rtw at freenet.co.uk> wrote:
>>> update "sessions" set "uid" = ?
>>> where "uid" = ?
>>> and exists(
>>> select * from "users" where "uid" = ?
>>> (v['uid'],s.SID, v['uid'])
>> This will be more efficient if you do "select uid from users".
>What will be more efficient ?
>Do you mean the "select * ..." or do you want to take the exists
>sub-query out and put it in a python if ?
"select uid" will be more efficient than "select *", although I suppose
I could be wrong about that given how little I know about current query
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"It is easier to optimize correct code than to correct optimized code."
More information about the Python-list