Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Architectural question...

by raafschild (Novice)
on Jul 05, 2005 at 21:04 UTC ( [id://472602]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Architectural question...
in thread Architectural question...

This certainly is a fruit of a different kind ;-).

You might want to store the results of the query in a summary table and have that table maintained by a set of triggers on the data table. That way the persistence and the caching is handled by the database, so you don't have to write it yourself.

Queries on this summary table should by quick, and all changes in the data table are immediately available in the summary table.

Sorry for a not very perlish suggestion in this forum.

Raafschild

Replies are listed 'Best First'.
Re^4: Architectural question...
by devnul (Monk) on Jul 06, 2005 at 02:30 UTC
    Its starting to drive me bananas... (sorry, I could not resist)

    The problem with storing it using triggers/materialized views is that the "where" clause against the data table is not constant. Sometimes I am searching the data table for records in a state, zip code radius, full-text search (using tsearch2), and about 3 other factors. So the "grouping" has to happen *AFTER* the result set is limited by the WHERE clause against the data table.

    .. I hope I explained that well enough...

    - dEvNuL

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://472602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-18 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found