473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

case for lock_timeout


Hi,

With reference to:

http://archives.postgresql.org/pgsql...6/msg00935.php

Consider a case

1. wherein a database dump takes 2 hrs to complete.
2. A cron gets fired which drops a certain table and recreates it.
3. A set of frequently requested web pages depends on reading from the table in 2

Since 2 will wait for 1 till it finishes, and 3 will wait for 2 this means those
set of webpages will become inaccessible while the backup is in progress.

Whereas if we have something like a lock_timeout 2 will abort within a limited
time duration automatically and the sys admin could get notified to reschedule
it and this problem can get averted.

I feel lock_timeout it will be a nice feature . Lemme know what would be
the solution of the above problem from existing set of features.

Regds
Mallah.



-----------------------------------------
Over 1,00,000 exporters are waiting for your order! Click below to get
in touch with leading Indian exporters listed in the premier
trade directory Exporters Yellow Pages.
http://www.trade-india.com/dyn/gdh/eyp/

---------------------------(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

Nov 23 '05 #1
3 1846
<ma****@trade-india.com> writes:
I feel lock_timeout it will be a nice feature . Lemme know what would be
the solution of the above problem from existing set of features.


AFAICS statement_timeout would work just fine for that; or you could
use NOWAIT.

regards, tom lane

---------------------------(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

Nov 23 '05 #2
Tom Lane wrote:
<ma****@trade-india.com> writes:

I feel lock_timeout it will be a nice feature . Lemme know what would be
the solution of the above problem from existing set of features.
AFAICS statement_timeout would work just fine for that; or you could
use NOWAIT.


ok, you mean we should put statement timeout with statements
that potentially lock table exclusively. eg

OTHER SQLS 1....
set statement_timeout = <some reasonable time>
DROP TABLE table_name;
set statement_timeout = 0;
OTHER SQLS 2....
BTW does drop table or alter table have any other reasons
to timeout other than waiting for a lock ? In former case
the query will get cancelled for an invalid reason.
Regds
mallah.
regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #3
Rajesh Kumar Mallah <ma****@trade-india.com> writes:
ok, you mean we should put statement timeout with statements
that potentially lock table exclusively. eg


Actually I think it'd work better to put NOLOCK on the read-only
operations. Those guys should never fail to get the lock they need
under ordinary circumstances. If you happen to be running some kind
of schema-altering process in parallel, then the read-only guys will
fail immediately instead of waiting, but AFAICT that's what you wanted.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
19
by: Robert Scheer | last post by:
Hi. In VBScript I can use a Select Case statement like that: Select Case X Case 1 to 10 'X is between 1 and 10 Case 11,14,16 'X is 11 or 14 or 16 End Select
1
by: ST | last post by:
Hi, I'm trying to debug someone else's code, and I'm going thru this Select Case statement. I'm having problems with the "OTHER" case...in that when the first line of the case is false, it jumps...
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
6
by: deanfamily11 | last post by:
I've set up a case statement to have my program determine where on the Cartesian plane a point the user enters is located. I keep getting the C2051 error when I compile. Any help? #include...
15
by: YitzHandel | last post by:
The following is an extract from my program, which I seperated out and compiled as its own program. The problem is that as soon as a case tests true, all the cases below it execute as well. So...
22
by: John | last post by:
Hi Folks, I'm experimenting a little with creating a custom CEdit control so that I can decide on what the user is allowed to type into the control. I started off only allowing floating point...
24
by: clockworx05 | last post by:
Hey guys i have this program that i need to write for class. here are the instructions: Write a function called foo that asks the user for their age. Pass the age value to a function called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.