Re: [GENERAL] database is bigger after dump/restore - why? (60 GB to 109 GB)

2011-02-24 Thread marcin mank
On Tue, Feb 22, 2011 at 9:44 PM, Aleksey Tsalolikhin wrote: > Most of our data is in a single table, which on the old server is 50 GB in > size and on the new server is 100 GB in size. > Maybe the table the on new server has fillfactor less than 100 ? Greetings Marcin -- Sent via pgsql-genera

Re: [GENERAL] sudoku in an sql statement

2009-11-04 Thread marcin mank
On Thu, Nov 5, 2009 at 12:39 AM, marcin mank wrote: > On Thu, Nov 5, 2009 at 12:31 AM, Richard Broersma > wrote: >> I don't get the same results: > > This is due to my email client breaking the lines. > Try this: http://pastebin.com/f2a0884a1 doh. http://www.pastie.or

Re: [GENERAL] sudoku in an sql statement

2009-11-04 Thread marcin mank
On Thu, Nov 5, 2009 at 12:31 AM, Richard Broersma wrote: > I don't get the same results: This is due to my email client breaking the lines. Try this: http://pastebin.com/f2a0884a1 Greetings Marcin Mańk -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

Re: [GENERAL] sudoku in an sql statement

2009-11-04 Thread marcin mank
> I think the Oracle guy's version could easily be adapted to PG 8.4 --- > those little rownum subqueries seem to be just a substitute for not > having generate_series(1,9), and everything else is just string-pushing. indeed. marcin=# with recursive x( s, ind ) as ( select sud, position( ' ' in s

Re: [GENERAL] Partitioned tables as a poor mans columnar index?

2009-10-16 Thread marcin mank
On Fri, Oct 16, 2009 at 9:19 PM, Peter Hunsberger wrote: > The basic problem I have is that I have some tables that are > potentially very long (100,000's to millions of rows) and very skinny, > and I end up with maybe a total of 12 bits of data in each row. Are You aware that there are some 20

Re: [GENERAL] PostgreSQL Object-Oriented Database?

2009-04-27 Thread marcin mank
Is there any sane reason to use an array column, besides performance (the values can be read in less disk seeks than in a table-with-a-foreign-key scenario)? Greetings marcin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.po

Re: [GENERAL] intermittant performance problem

2009-03-29 Thread marcin mank
On Sun, Mar 29, 2009 at 10:24 AM, marcin mank wrote: > I think (a part of) Your problem is that order by random() is O(N > logN) complexity, while You are after O(N) . > > The solution (in pseudocode) > [snip] OK, I may be guiding You the wrong way select g,g,g,g from

Re: [GENERAL] intermittant performance problem

2009-03-29 Thread marcin mank
I think (a part of) Your problem is that order by random() is O(N logN) complexity, while You are after O(N) . The solution (in pseudocode) random_sample(resultset,K): result := first K rows from resultset resultset.scrollto(K+1) p = K+1 while(resultset.hasMoreRows()) row = result

Re: [GENERAL] What is the best plan to upgrade PostgreSQL from an ancient version?

2009-01-26 Thread marcin mank
On Mon, Jan 26, 2009 at 10:37 PM, Dann Corbit wrote: > My notion is to do a character mode database dump as SQL statements and > then load into the new version by execution of psql against the sql > STATEMENTS. > > What are the "gotchas" we can expect with this approach? > > When I say 'ancient' I

Re: [GENERAL] Query sometimes takes down server

2009-01-15 Thread marcin mank
> I have a dynamically built query that will periodically(2 times a day and > becoming more frequent) make my server totally unresponsive. does this query involve more than geqo_threshold (default 12) tables? If so, this most probably is geqo (genetic query optimizer) kicking in. Try to fiddle wi

Re: [GENERAL] View vs Constantly Updated Table

2008-12-16 Thread marcin mank
It is generally better to save the balance. The general rule in accounting systems design is "what can be printed, should be explicitly on disk". for an invoice: value before tax, tax percentage, value after tax, total before tax, total after tax, etc, should all be saved explicitly. An account s

Re: [GENERAL] Using Postgres to store high volume streams of sensor readings

2008-11-23 Thread marcin mank
>Yes, the figures are like this: >* average number of raw inserts / second (without any optimization > or previous aggregation): #clients (~ 100 thousand) * #sensors (~ 10) > / 6seconds = 166 thousand inserts / second... this is average? 166 000 * 20 bytes per record * 86400 seconds per da

Re: [GENERAL] join question

2008-10-22 Thread marcin mank
>Sort Method: external sort Disk: 1320kB One simple speedup could be upping Your work_mem to 2M for this query, so the sorts are in memory. btw: Last time I used Postgres, it did not show the sort method. Cool. Greetings Marcin Mank -- Sent via pgsql-general mailing list (pgsql-gene

Re: [GENERAL] query takes a long time

2008-08-23 Thread marcin mank
> > select count(distinct attendance.studentid) > > from attendance > > where attendance.studentid not in (select studentid from attendance where > auth not in('C','E','F','G','H','I','M','N','O','R','S','T','U')) > > I am tired a lot now, but isn`t it the same as: select count(distinct attendanc

Re: [GENERAL] Recovering deleted or updated rows

2006-11-15 Thread Marcin Mank
- Original Message - From: "Florian G. Pflug" <[EMAIL PROTECTED]> To: Sent: Wednesday, November 15, 2006 11:19 AM Subject: [GENERAL] Recovering deleted or updated rows > Hi > > I'm looking for a way to recover deleted or old versions of > accidentally updated rows from a postgres 7.4 d

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Marcin Mank
> gives the result below. It seems inconsistent to me with > regard to the FOUND variable. I would expect FOUND to always > be false regardless of whether I use EXECUTE or PERFORM. I > certainly do not expect it to be true for the third EXECUTE > even assuming that PERFORM may have a bug. What is i

Re: [GENERAL] references/tutorial/tricks on dynamic generation of sql (& plpgsql functions) editing/coding

2006-09-11 Thread Marcin Mank
> I'm using pg 7.4 so $$ trick shouldn't work. Should work. if you put enugh $$, somebody might backport this for you ;) how about: create or replace function SP_GarbageCollectionGenerate() returns bool as ' declare v_query text; begin v_qyery=''create or replace blah blah :para1 blah b

Re: [GENERAL] I need help creating a query

2006-07-14 Thread Marcin Mank
- Original Message - From: "Sergio Duran" <[EMAIL PROTECTED]> To: Sent: Thursday, July 13, 2006 9:20 PM Subject: [GENERAL] I need help creating a query > Hello, > > I need a little help creating a query, I have two tables, worker and > position, for simplicity sake worker only has its