I think that's a good question. If you are worried about load, you obviously want to make the queries run as quick as possible and/or only when needed. If you don't have a high load on your system, then it really doesn't matter to much about the side queries since MySQL probably isn't doing much anyway. But, you then know the design is not scalable.
Not sure how your database design is setup, but what I usually do is have a timestamp field in the database being queried. This field is automatically updated if a record is changed (and it's the first timestamp field). Your front end then stores the value of the max timestamp in the database. The timestamp field should obviously be indexed. Instead of querying the summary information each time, you query (count(*)) for a timestamp greater than the one you have stored on the "client" (i.e. in a session variable). This query should execute very quickly with minimal resource usage. If you find one or more records, then you know data has changed and you rerun your summary queries.


But, if you have query cache enable, then MySQL will actually kind of handle things for you since it will cache the query results until something changes.


On Sep 3, 2004, at 5:24 AM, Stuart Felenstein wrote:

In my web design I have a side bar to provide quick
info and links to account information.

Examples would be account basics:
Welome : Name, Company, Last Visit , ..........

One idea that brings me to this question:
In the side bar I list out how many resumes member has
on file, so:
Title1 - Then I can also add an update link to the
record
Title2
Title3
As well a return on count() query, > number_allowed
e.g. Add (1)

At the same time I also have a main "account summary
page" which contains some of this plus more detailed
information then I'd consider putting inthe side bar.

So, I'm wondering how concerned I should be about
these little  queries that I'm putting in the side
bar.

Thank you,
Stuart


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to