Re: [ADMIN] question on warm standby

2008-11-13 Thread Tom Lane
"Mark Steben" <[EMAIL PROTECTED]> writes: > I am running postgres 8.3.4 on master(mymachine) and slave(hummer). I am > attempting to implement warm standby. > 1. On mymachine I have the following archive_command: > Scp %p [EMAIL PROTECTED]:/var/backups/archlog/%f > (scp has been

[ADMIN] question on warm standby

2008-11-13 Thread Mark Steben
Hi, My problem probably is that I need to look at the forest but am hyper-focusing on a maple twig. I have been looking at this for 2 days now And would appreciate some feedback... I am running postgres 8.3.4 on master(mymachine) and slave(hummer). I am attempting to implement warm standby. 1.

[ADMIN] db restore question/issue

2008-11-13 Thread Isabella Ghiurea
Hi All, I 'm running some db backups tests & recovery , using pg_dump d name --b - F c - db.backup , when I test my restore using pg_restore dbname and if I run the restore for 2 times in the row for same db the data gets duplicated in tables is this a feature in pgsql or I 'm missin

Re: [ADMIN] function executes sql 100 times longer it should

2008-11-13 Thread Vyacheslav Kalinin
Apparently your problem starts here: > -> Function Scan on filter_b_preke_matoma (cost=0.00..267.50 rows=5 width=126) (actual time=6.580..11.766 rows=2820 loops=1) > Filter: (((prek_pavadinimas)::text ~~* (('%'::text || ($3)::text) || '%'::text))

Re: [ADMIN] function executes sql 100 times longer it should

2008-11-13 Thread Julius Tuskenis
Thank you Vyacheslav. your "bit or street magic" worked and now I have Execution Plans for both queries: from function and simple SQL. I'm not good in reading and interpreting these please advice witch part should I put my attention to? FUNCTION: "Unique (cost=290.13..290.15 rows=1 width=

Re: [ADMIN] function executes sql 100 times longer it should

2008-11-13 Thread Vyacheslav Kalinin
Most likely, you get different plans because the function has to deal with the parametrized query, hence planner cannot effectively use statistics. For example conditions like this WHERE (grup_id=$2 OR $2 is Null) would prevent planner from use of index (if there is one), while with literal query t

Re: [ADMIN] function executes sql 100 times longer it should

2008-11-13 Thread Julius Tuskenis
Hello Sean, Explain plan might be a good start Its a good start, but leads to nothing because Explain doesn't go into the function. EXPLAIN select * -- prek_id, prek_pavadinimas, ks_kaina, mvnt_trumpinys from fnk_grupes_prekes(18,42,NULL); "Function Scan on fnk_grupes_prekes (cost=0.00..2