waiting for pg 8.4

i will try to follow development of 8.4, and write examples of what's possible with it, based on current HEAD code.

of course there is no guarantee that it will work in final, released 8.4 (it is a bit too early to talk about it, but given the fact that the patch got committed, there is pretty good chance we will see it whenever 8.4 will be released.

today 2 new features: limit (select ) and optional as in select.

Continue reading waiting for pg 8.4

smtp + sql = more than it seems so (part 1)

for quite some time i wanted to write about my experiences with combining smtp server with sql server.

this subject for some people might be too boring, for others – it might be seen as a simple howto. but in my opinion it clearly shows that when you combine 2 such technologies outcome is much better then it would seem (it's called synergy in merketoid-speak).

this subject will be divided into several parts, that will be posted separately (yeah, let's get some traffic to website 🙂

also, i hope to extend it in future if/when i'll find something else that can be added/changed in proposed solution.

so, without further ado, let's start:

Continue reading smtp + sql = more than it seems so (part 1)

it’s coming, it’s coming, it’s here, have no fear

(pgdba@[LOCAL]:5830) 21:45:26 [pgdba]
# SELECT version();
                                                        version
-----------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.3.0 ON i686-pc-linux-gnu, compiled BY GCC gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
(1 ROW)

well, actually it is not released yet, but at the very least it's named 8.3 in cvs head 🙂

how to check if given update is from trigger or why i hate orms?

  • we use orm
  • yes, and?
  • and we have a problem with it…
  • you already said that

now, imagine a simple scenario:

  • objects table (let's name it “topics"), which contains column: posts_count
  • sub-objects table (posts), with foreign key to topics
  • triggers which update posts_count on insert/update/delete on posts

simple? yes? well. it was. now, enter disaster: orm.

Continue reading how to check if given update is from trigger or why i hate orms?

how many 1sts of any month were sundays – since 1901-01-01?

nixternal wrote about boost library for c++.

with it he was able to find the answer to title question in miliseconds (he didn't specify how many, but let's assume that is was less than 10 ms).

so i decided to check how fast can i do it in postgresql …

Continue reading how many 1sts of any month were sundays – since 1901-01-01?

shared buffers and their impact on performance

just lately we found interesting case about shared_buffers settings.

the database in question is rather simple:

  • 3 tables
  • a bit over 60 gigabytes
  • around 150 million rows

the server we run it on is not really fancy:

  • 2, single core, 3ghz xeons
  • 16 gb of ram
  • 6x 72gb, scsi, 15krpm discs in low-end hardware raid 10.

Continue reading shared buffers and their impact on performance