Hello,
I have a table with a rule that goes something like this:
CREATE OR REPLACE RULE sometable_delete ON DELETE DO delete FROM cache
WHERE tablename='sometable';
CREATE OR REPLACE RULE sometable_insert ON INSERT DO delete FROM cache
WHERE tablename='sometable';
CREATE OR REPLACE RULE sometable_update ON UPDATE DO delete FROM cache
WHERE tablename='sometable';
And what I have is set of objects which for certain queries will populate
a serialized variable into the cache table, like this:
INSERT INTO cache (tablename, cache_key, datavalue) VALUES ('sometable',
'some_md5_hash', 'serialized_data');
Using this method it is possible for me to just do a:
SELECT datavalue FROM cache WHERE tablename='sometable' AND
cache_key='some_md5_hash';
... and if I get an empty value for datavalue then execute the query
normally, process it, then store the serialized data back into the cache...
This all works very well for this situation, it has sped up my
application about 20 times for 95% of the requests....
The problem I have is there are frequently times I need to update
sometable and not have the rule execute, specifically when I am updating
something in the table which does not affect aggregate results.
Is there a way to cause the rules to be temporarily disabled for these
types of queries?
Thanks!
- Greg
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match 1 3915 ma**********@net-virtual.com ("Net Virtual Mailing Lists") wrote: CREATE OR REPLACE RULE sometable_delete ON DELETE DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_insert ON INSERT DO delete FROM cache WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_update ON UPDATE DO delete FROM cache WHERE tablename='sometable';
And what I have is set of objects which for certain queries will populate a serialized variable into the cache table, like this:
INSERT INTO cache (tablename, cache_key, datavalue) VALUES ('sometable', 'some_md5_hash', 'serialized_data');
Using this method it is possible for me to just do a:
SELECT datavalue FROM cache WHERE tablename='sometable' AND cache_key='some_md5_hash';
.. and if I get an empty value for datavalue then execute the query normally, process it, then store the serialized data back into the cache...
This all works very well for this situation, it has sped up my application about 20 times for 95% of the requests....
The problem I have is there are frequently times I need to update sometable and not have the rule execute, specifically when I am updating something in the table which does not affect aggregate results.
Is there a way to cause the rules to be temporarily disabled for these types of queries?
Not that I know of (apart from doing a remove/add). However, possibly
if you were to add a view which had update rules to do the update on the
real table as well as the cache changes you could then update the real table
manually and not affect the cache (although you could then not guarantee
that someone wouldn't do something that would affect the cache directly). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Robert Brown |
last post by:
suppose I have the following table:
CREATE TABLE (int level, color varchar, length int, width int, height
int)
It has the following rows
1, "RED", 8, 10, 12
2, NULL, NULL, NULL, 20...
|
by: Tuong Do |
last post by:
Hi,
I am going to insert a large amount (200,000 records) of data into a table
Is there a way that I can temporarily disable the log? so that the insertion
run faster
Thanks in advance
|
by: Sharktyyfa |
last post by:
Hi, hoping someone can help.
Access 2003, WinXP.
I have built a database that uses synchro to co-ordinate with the
mothership.
All is well.
The person i built it for wants the satellites...
|
by: dw |
last post by:
Hello, all. We're building a Web app where we can have any number of
questions, which can contain any type of form element -- check boxes, text
fields, radio buttons, dropdowns, etc. We'd like to...
|
by: Jon Slaughter |
last post by:
Is there any method to temporarily disable focus changing?(I assume only
method is tab or mouse?) This problem has been tieing me up for a while and
nothing seems to work. The only thing that I...
|
by: =?Utf-8?B?Q2hyaXM=?= |
last post by:
Hi,
I have a user with lots of protected documents in a folder. Is it possible
to create a small app which can be used to unprotect all the files in a
folder on one click and then after all...
|
by: shapper |
last post by:
Hello,
I have the following list:
<ul id="parent" class="parent">
<li>
<img...
</li>
<ul id="child" class="child">
<li>Message 1</li>
|
by: Vince C. |
last post by:
Hi all.
I've installed Bloodshed Dev-C++ on a Windows 2000 SP4 machine. I'm using
MinGW 3.4.2.
I'd like to temporarily disable standard functions to write to stderr, i.e.
for instance...
|
by: hsriat |
last post by:
How can I temporarily disable vertical scrollbar?
I have replaced confirmation boxes and alert boxes with inlay popup DIVs. But while they are on the screen, I need to disable scrollbar of the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| | |