I am using SQL, and MiniVend is so SLOW.....

### Index Up << >>

## I am using SQL, and MiniVend is so SLOW.....

It isn't MiniVend.

First of all, did you index your 'code' field? The reason MiniVend doesn't do it for you is that every SQL database seems to do that a bit differently. Even then, you can do some stuff with MiniVend's COLUMN_DEF parameter:

      Database  products  COLUMN_DEF  code=char(16) PRIMARY KEY

That will index at least the `code` field for MySQL. Other databases differ.

MiniVend can return VERY fast SQL search results. But you need to at least give it something to work with. The proper method for fast selection is:

     [sql type=list
          query="select code,category,title,price from products" ]

     Category: [sql-param category]<BR>
     Title:    <A HREF="[area [sql-code]]"> [sql-param title] </A><BR>
     Price:    <A HREF="[area order [sql-param 0]]"> [sql-param price] </A><BR>

     [/sql]

IMPORTANT NOTE: The sql-param tag did not accept named fields before MiniVend 3.12beta4. Access with `[sql-param n]`, where `n` is a modulus-zero positional field set from your query. In the example above, code=0, category=1, title=2, price=3.

This is especially powerful when you consider a joined query like

            SELECT code, price, title, extended.desc
            FROM   products, extended
            WHERE  products.category = 'Renaissance'

That will index at least the `code` field for MySQL. Other databases differ.

Don't forget that you must index your fields if you want fast searching with them as a criteria.

Here is a nice synonym for `[sql type=list ...]`:

     [new]
     [search-region arg="
         st=sql
         ml=1000
         sq=select code,title,artist,price from products where code < '5'
         "]
     <PRE>
     [search-list][item-code]: [item-param title] [item-param artist] [item-param price]
     [/search-list] </PRE>

     [/search-region]

### Index Up << >>