i looked at the file "\src\backend\commands\async.c"
there is a check for duplicate messages
/******** PG 10
if (AsyncExistsPendingNotify(channel, payload))
return;
***********/
/******** PG 13
if (AsyncExistsPendingNotify(n))
{
…...
}
***********/
Is this slowdown related to this check?
Is it possible to skip the check if I'm absolutely sure the message is unique?
--
Arsen Arutyunyan
Arsen Arutyunyan
Вторник, 15 марта 2022, 10:34 +03:00 от Арсен Арутюнян <arutar@xxxxx>:
1)select version();version------------------------------------------------------------PostgreSQL 10.6, compiled by Visual C++ build 1800, 64-bit2) $PGDATA/pg_notify/Sometimes this folder is empty, sometimes it contains the file I have attached. The file is always less than 200kb--
Arsen ArutyunyanПонедельник, 14 марта 2022, 15:53 +03:00 от Арсен Арутюнян <arutar@xxxxx>:
Hello! I'm having trouble with LISTEN/NOTIFY speed. Now I have about 100-200 (few?) clients who are actively messaging. But recently I started to notice a drop in speed. Changing the log_min_duration_statement parameter did not show slow queries in the log.As it turned out, the pg_notify(text ,text) functionor theNOTIFY text, 'text' queries takes an extremely long time (0.7-1.5sec),but the select pg_notification_queue_usage() query always returns 0.Please tell me what's the matter, where did I make a mistake?What needs to be done to increase the speed of adding to the message queue?--
Arsen Arutyunyan|What PG version is this exactly? What is in $PGDATA/pg_notify/ ?| regards, tom lane