I'm running postgresql server on Windows Server 2008, which has 6GB of ram. My dataset is something near 1,5GB big.
I have problems, when I run specific SQLs in table, which has 51mio of records. The fields which I use in SQLs are indexed (alarm, id_elektrarna, id_razsmernik). Below is the ANALYZE SQL, which causes problems. Do you have any suggestions what to do?
When I run my query, I see how memory of the system where database is running is increasing, while some scripts that are using database just "pause" working. When I stop SQL from running, everything works again.
There are additional data: #work_mem = 1MB (commented), shared_buffers = 32MB,
index definition, table definition, SQL that is the issue: http://pastebin.com/4iMtpD4r
The database server is using the RAM, not the client application. This is the SQL with EXPLAIN (ANALYZE,BUFFERS) that executes in less than 1sec and do not cause problems. Same SQL, different UNIT in database (different ID) takes more than 15-30minutes: http://explain.depesz.com/s/OdqU.