Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inefficient query
Message
 
 
To
24/01/2007 17:36:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01188966
Message ID:
01189112
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
>>
>>select *, 'Missing' as cInfo from FirstResult where ID not in (select ID from mySecondResult) ;
>>union all ;
>>select *, 'Extra ' as cInfo from mySecondResult where ID not in (select ID from FirstResult)
>
>
>Excellent idea. :)
>
>I am starting to see that the query is not my problem. This little exercise is part of a Fox-enabled web site using Active Foxpro Pages. The query itself appears to only take a fraction of a second to run in fox, but the code that produces results rows for the html table is slow, now that I test them both.
>
>Assuming temp to be the result cursor from the previous query, does this look like an inefficient use of TEXTMERGE to produce my html result set rows? This produces one HTML table row per query result, the resulting text is then written out to the client with response.write()
>
>
>
>
>Function CreateTableRows
>	Local cText,i
>	i = 0
>	If !Used("temp")
>		Return []
>	Endif
>	cText = []
>	Select temp
>	Scan
>		i = i + 1
>		TEXT TO cText ADDITIVE TEXTMERGE NOSHOW
>  <tr bgcolor="#dcdcdc" class="QueryTable">
>    <td width="103" bgcolor="#dcdcdc" class="FieldHeadings QueryResults">
>      <input name="WorkCode<<i>>" readonly type="text" class="TableHeadings" id="WorkCode<<i>>" value="<<temp.wcode>>" size="15" onclick="MM_goToURL('parent','<<>>');return document.MM_returnValue" />
>    </a> </td>
>    <td width="360"><span class="QueryResults">
>      <input name="Borrowername<<i>>" readonly type="text" id="Borrower_Fname<<i>>" value="<<temp.borrowername>>" size="50"/>
>    </span></td>
>    <td bgcolor="#dcdcdc"><span class="QueryResults">
>      <input name="Loan<<i>>" readonly type="text" class="TableHeadings" id="Loan<<i>>"  onclick="MM_goToURL('parent','<<>>');return document.MM_returnValue" value="<<temp.display_loan>>" />
>    </span></td>
>    <td bgcolor="#dcdcdc"><span class="QueryResults">
>      <input name="Parcel<<i>>" readonly type="text" id="Parcel<<i>>" value="<<temp.acct>>" />
>    </span></td>
>  </tr>
>		ENDTEXT
>	Endscan
>	Return cText
>Endfunc
>
>
I would probably do it slightly different way, e.g. put
set textmerge on
set textmerge to memvar lcHTML noshow
scan
\ ....
endscan
In other words, you only set textmerge once before the scan. I'm not sure, how much would it speed up the process.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform