Thankx guys for your support.
I have gotten rid of the "SELECT *" most of the tables and the speed is wonderful. The tables were the main culprits, so now im using style sheets. Works fantastic.
Thanks again
Thankx guys for your support.
I have gotten rid of the "SELECT *" most of the tables and the speed is wonderful. The tables were the main culprits, so now im using style sheets. Works fantastic.
Thanks again
Ok, stop with the Erk now, this is sample code.
<FONT size=+0>I guess fld2 is shorthand for field2 so couldn't you just do
</FONT>
<FONT size=+0>"SELECT fld2 FROM table" instead? That'll give a speed improvement.
Or, you even change your if/elseif to
SELECT FldID FROM table1 WHERE Fld2 = 1</FONT>
<FONT size=+0>Fld2 is either 1 or 2. I need all the fields from the table thats why i use "SELECT *" but only the ones with value 1 are displayed with a record count corresponding to the field Id of the fields with value 2. Its a complicated process.
recordsArray is supporsed to work as temp storage for easier sorting, like a query in MS ACCESS, so it is again looped for the display with the sorted records and corresponding counts.
@carfield said:
However my colleague think "don't fix if it not broken anything else". May be he is correct... what do you think about it? Besides, any agrument (or benefit) , for change the datatype to boolean?
I agree with you colleague. Besides with my minimal experience with mysql i don't think it supports boolean. Unless you are using MS-Access
@rsynnott said:
@human said:Finally i have managed to work my way around the asp. At least i have a processing speed of 1.5 sec on both functions. The rest i leave to the layout designer.
That's still not at all fast for what you're trying to do. What database are you using?
If there is a faster way,,,,im listening. The db is mysql
<FONT face=Verdana size=1>Ok guys, sorry for being rude. Here is the code. Im using a mysql dabase. These are the 2 functions running on home page.</FONT>
<FONT face=Verdana color=#ff1493 size=1>Function display(strPageId,strDisplStyle)
'[open database]</FONT>
<FONT face=Verdana color=#ff1493 size=1> Sql="SELECT * FROM table1"
SET rst=strConnect.Execute(Sql)</FONT>
<FONT face=Verdana color=#ff1493 size=1> While Not dbObjRst.eof
If fld2="1" then
recordsArray(0,intRecCount) = rst("FldId")
elseIf fld2="2" then
recordsArray(1,intRecCount) = countrecs("table2")
end If
'[increment array counter]
intRecCount=intRecCount+1</FONT>
<FONT face=Verdana color=#ff1493 size=1> rst.MoveNext
Wend
rst.close: Set rst=Nothing
writerecords intRecCount,recordArray
End Function</FONT>
<FONT face=Verdana color=#ff1493 size=1>Function lastUpdates(intRecsNumber)
'[declarations]</FONT>
<FONT face=Verdana color=#ff1493 size=1> Sql="SELECT * FROM table3 ORDER BY recDate DESC;"</FONT>
<FONT face=Verdana color=#ff1493 size=1> rs.CursorLocation = adUseClient
rs.Open Sql, strConnect, adOpenStatic, adLockReadOnly
fieldsCount=rs.fields.count
intCounter = rs.RecordCount
If Not intCounter = 0 Then arlsts = rs.GetRows()
rs.close: set rs=nothing
'[loop found rows]
For r=0 to intCounter-1
'[exit loop after desired records]
If cINT(r)=cINT(intRecsNumber) Then Exit Function</FONT>
<FONT face=Verdana color=#ff1493 size=1> '[display record in selected HTML format]
displayrec arlsts (11, cINT(r))
Next
End Function</FONT>
<FONT face=Verdana size=1>Both functions process like 500 records.</FONT>
Finally i have managed to work my way around the asp. At least i have a processing speed of 1.5 sec on both functions. The rest i leave to the layout designer.
I have an asp home page has 2 major functions: One function should query about 500 records from a database, format and display the records;
The second function queries about 400 records and only displays 10 latest according to a certain flag.
The problem is that the page takes too long to load. I have the display in tables and a few cached images. I have tested the asp separately and the loading time is not very bad but when i incorporate the function in htm/asp page it takes ages.
Can anyone help????