[PERFORM] DELETE, INSERT vs SELECT, UPDATE || INSERT

2005-12-23 Thread Anton Maksimenkov
Hi, all. While working on algorithm of my project I came to question. Let it be table like this (user+cookie pair is the primary key). INT user INT cookie INT count Periodically (with period 10 minutes) this PostgreSQL table updated with my information. The main problem that some of pairs (us

[PERFORM] select with "like" from another table

2006-05-29 Thread Anton Maksimenkov
Hi. I have 2 tables - one with calls numbers and another with calls codes. The structure almost like this: billing=# \d a_voip Table "public.a_voip" Column |Type | Modifiers +

Re: [PERFORM] select with "like" from another table

2006-05-29 Thread Anton Maksimenkov
> I have 2 tables - one with calls numbers and another with calls codes. > The structure almost like this: ... How long does this query take? SELECT code FROM a_voip_codes c, a_voip v where v.called_station_id like c.code || '%' order by code desc limit 1 billing=# explain analyze SELECT code F

[PERFORM] How exactly PostgreSQL allocates memory for its needs?

2010-02-09 Thread Anton Maksimenkov
Can anybody briefly explain me how each postgres process allocate memory for it needs? I mean, what is the biggest size of malloc() it may want? How many such chunks? What is the average size of allocations? I think that at first it allocates contiguous piece of shared memory for "shared buffers"