[ic] SQL ?

Michelle Wilant interchange-users@interchange.redhat.com
Sat Dec 8 01:56:00 2001


<cheering you on>Keep learning MySQL</cheering you on>

In our research it seems (correct me if I'm wrong, IC gurus) that the 
interchange formatted query actually calls the whole table of 
information back to IC and then parses it according to what you really 
want in your query.   So basicly doing a select * from table -- no 
matter what you put down for those se= .. sf=.. and so on.  That's where 
the load comes in.  Our search box was taking 30 seconds to show the 
results.  By then the customer has vanished.  Plus, having IC 
continually do select * created quite a load on our mysql box.  

Make mysql do the work.  I'm on the "Learn MySql and have IC really kick 
some A**" campaign.  I did send another email a little bit ago that 
should hopefully answer the <a> tag question you bring up below.   But 
just for the archive and anyone else reading, use forms -- create a link 
like <a 
href="http://www.yoursitehere.com/cgi-bin/store/categoryresults.html?category=bar>Bar</a>. 
 Then copy results.html as categoryresults.html and place your query in 
there.  It could be like so:
[query  type=list
            ml=10 -- how many per page if you use the [more] tags
            more=1
            sql="select title, price from products where category like 
'%[cgi category]%' limit 100 order by title asc"]

       

joachim.richter wrote:

>Thanks for the answer Jon,
>
>as I read my last question, i realised that I forgot to mail the top section
>with all the details like we are using interchange 4.81 and a MYSQL database
>sorry about that.
>
>I understand that
>
>[query more=1 ml=10 st=sql sql=|
>SELECT sku FROM products
>WHERE category = 'TEST'
>|]
>
>and
>
>[list][sql-item description][/list][/query]
>
>will actually access the sql database via sql statements and is therefore superfast.
>
>Heres a try to use an SQL statements in a link
>
><a href="[area href=scan arg=|
>SELECT sku FROM products
>WHERE category = 'TEST'
>|]">CLICK ME</a>
>
>the link actually works, but if I check the bottom line of the browser (by moving the mouse on the link)
>
>I read : ..../scan/fi=products.txt/rf=sku/co=yes/nu=0/se=TEST/op==/sf=category/ne=0.html
>
>now the link accesses the textfile and not the database directly,
>which means somehow I have to get the st=sql in there !
>>From my amateur point of view I believe that interchange changes the
>qualified sql statement into an interchange link, because the link gives me a
>BAD_SQL if I add this to the statement ORDER BY category ASC LIMIT 50
>
>well basically then the link you gave me (below) is the same except the missing st=sql
>
><a href="[area href=scan arg=|
>	fi=products
>	st=sql
>	co=1
>	sf=category
>	se=TEST
>	ml=10
>|]">CLICK ME</a>
>
>See the reason for those questions is the amazing difference in speed. The query gives an results within seconds
>while the link takes a lot longer. 
>
>What I like to know is how to change the link therefore it also accesses the SQL database via SQL statements
>to achieve the same breathtaking speed the query has.
>
>Or am I like completely mistaken ? If that is so I am really sorry, but I just bought a book on MYSQL and I am
>doing my first steps so to speak, and thats where I got the idea from, because even the most complicated query
>pops up results within seconds.
>
>JoE
>
>US Video Center Medien GmbH
>Heimsheimer Str 22
>70499 Stuttgart
>
>Tel 0711 880252 0
>Fax 0711 880252 22
>Email joachim.richter@usvideocenter.de
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users
>
>.
>