MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Item availability



Quoting Christian J. M|ller (cmueller@polinet.ch):
> 
> I have implemented an inventory check. I do not think that it would
> substantially reduce performance, since the check is only performed on
> the items presented by the results page. If you have unique items, then
> you could further improve performance by periodically running a script
> that removes items with 0 quantity from the products database.


This is true -- especially if you access it in the same
item-data row that you use other data from the same table.

If you do:

	[item-data products description]

Then any other [item-data products ....] and [if-data products ...] tags *in
the same row* are essentially free and are very high performance.

[data products field ...], on the other hand, gets expensive because
another row gets fetched besides having to go to the tag parser.

And [item-data foo bar] has to fetch another row. Once it is fetched,
performance goes up for that row.

If you have only one ProductsFiles then [item-field ...] is included
in this. There is a performance thread on the mail list (1997) which
lead to me putting in this stuff. It immediately boosted MiniVend's
performance.

People often wonder why you can't do 

	[item-data table=products column=price key="...."]
	   or
	[if-data products free_shipping eq 'YES']

Answer is, once again, performance. Parsing parameters is expensive.
Regular-expression substitutions are not. That is why when designing
for MiniVend performance your true/false conditions should be 1 and
0-or-blank. 

Database performance is all about localizing frequently accessed data
to reduce the hits on the database, and with the MiniVend DBM databases
it is also all about memory on the system. GDBM and DB_File have very
useful caching mechanisms; I have a couple of catalogs that are heavily
hit that virtually never touch the disk; their data sets are almost
always in RAM even though the putatatively reside in a GDBM database.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
                                    131 Willow Lane, Floor 2  | ||  _ \
It's a little-known fact            Oxford, OH  45056         | || |_) |
that the Y1K problem caused         <mikeh@minivend.com>     |___|  _ <
the Dark Ages. -- unknown           513.523.7621 FAX 7501        |_| \_\


Search for: Match: Format: Sort by: