'NOTIFY' slows down postgres?
От | Cheirie Shum |
---|---|
Тема | 'NOTIFY' slows down postgres? |
Дата | |
Msg-id | Pine.SOL.3.96.1020208163106.16045A-100000@teach.ic.ucsc.edu обсуждение исходный текст |
Ответы |
Re: 'NOTIFY' slows down postgres?
|
Список | pgsql-general |
Hi, I currently have a tcl program that: (script 1) -communicates with the postgres database -'listens' to every update ( a notify was previously executed on postgres' side) -then sends the new updated information to a client. I have another tcl script that: (script2) -communicates with the postgres database -runs 400 updates on one table ( I change a value and then change it back ) -prints out the elapsed time. So anytime script2 updates something, script1 knows about it. a.) When I run script2 without script1, without a listen or a notify, script2 finishes running in 3 seconds. (ie: script1 has no clue as to what is going on... and postgres doesn't let anyone know what was updated) b.) Adding a 'notify script1' to the above configuration, script2 finishes running in 7 seconds. (!!) c.) Adding script1 ( ie: script1 is now running, listens for updates and postgres notifies script1 about every update but does nothing with its new knowledge) script2 finishes in 16 seconds. Note: Everytime i run script2, the results of parts c increase steadily by about 1 second. However, the results of parts a and b have been consistent. What is it about the notifies and listens that slow my script down? What can i do to make these notifies go faster? Any help would be appreciated. Thanks in advance, cheirie cshum@cats.ucsc.edu
В списке pgsql-general по дате отправления: