Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Moving to a specific row
Date: Sep 1 2000 12:48AM

Jeff Greif writes:

 > In this case, an easy (but very inefficient) way to do it is, in the above
 > stored procedure, to execute the above query into a temporary table on every
 > web page access, execute DELETE FROM #temphits WHERE CATEGORY IN (SELECT TOP
 > @pagesize*@pagenumber CATEGORY FROM #temphits), and then SELECT TOP
 > @pagesize from #temphits.  I know it's gross, but it does meet the UI
 > requirements, including the near statelessness between pages.

THings like this also depend on load, number of requests per second,

Your example would seem to indicate viewing some sort of access log,
which is probably done by a (relatively) small number of people. The
performance requirements there might be different from a request that
is used on a public site with 10s of millions of hits per day.

In any case there are various solutions. One would be to establish a
session, and to create a "permanent" temporary table with the
appropriate data associated with that session. That table would hold
only the rows that correctly reflect the query the user requires. It's 
also a (maybe small) performance improvement if the user pages through 
several pages because you essentially denormalize the table (ie you
remove any sum(), joins, etc from the actual request that is run on
the second and subsequent pages.

Of course this is now quite far from sybperl-specific issues, but at a 
guess quite a few of us are involved with web/cgi related issues,

Michael Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: