Grokbase
x

Palle Girgensohn (g...@pingpong.net)

Profile | Posts (66)

User Information

Display Name:Palle Girgensohn
Partial Email Address:g...@pingpong.net
Posts:
66 total
12 in PostgreSQL - Admin
4 in PostgreSQL - Bugs
12 in PostgreSQL - General
7 in PostgreSQL - Interfaces
16 in PostgreSQL - JDBC
2 in PostgreSQL - ODBC
13 in PostgreSQL - Performance
3 in PostgreSQL - SQL

5 Most Recent

All Posts
1) Palle Girgensohn Re: lost data, possible playback?
| +1 vote
--On torsdag, december 06, 2007 12.22.45 -0500 Tom Lane <tgl@sss.pgh.pa.us> OK, my assumptions...
PostgreSQL - Admin
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
--On torsdag, december 06, 2007 12.22.45 -0500 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

> Palle Girgensohn <girgen@pingpong.net> writes:
>> Is the real reason for the negative answer that there is a "hole" in the
>> pg_xlogs from 3 am - 9 am?
>
> That's half of it. The other half is that what you have from 3am is a
> pg_dump, not a filesystem-level snapshot of the database, and you'd need
> the latter to be able to replay the WAL log against.

OK, my assumptions where correct. Thanks.

/Palle
2) Palle Girgensohn Re: lost data, possible playback?
| +1 vote
--On torsdag, december 06, 2007 17.45.57 +0100 Palle Girgensohn Is the real reason for the negative...
PostgreSQL - Admin
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
--On torsdag, december 06, 2007 17.45.57 +0100 Palle Girgensohn
<girgen@pingpong.net> wrote:

>
>
> --On torsdag, december 06, 2007 10.41.40 -0600 Scott Marlowe
> <scott.marlowe@gmail.com> wrote:
>
>> On Dec 6, 2007 10:24 AM, Palle Girgensohn <girgen@pingpong.net> wrote:
>>> Hi!
>>>
>>> A user accidentally deleted some results (i.e. tuples in a postgresql
>>> database) created this morning.
>>>
>>> I have pg_xlog from about 9 o'clock until now. I have a pg_dump from ab
>>> out 3 o'clock this morning.
>>>
>>> The results where created from about nine o'clock until noon, when the
>>> user accidentally removed the results.
>>>
>>> Would it be possible to replay the WAL logs and get the results from
>>> pg_xlog + the dump?
>>
>> No.
>>
>>> Or from a file system snapshot as of now (five pm) + pg_xlog?
>>
>> No.
>
> So, I *must* have an image of the entire database, and I *must* have all
> WAL files since the image snapshot was taken?

Is the real reason for the negative answer that there is a "hole" in the
pg_xlogs from 3 am - 9 am?

Palle
3) Palle Girgensohn Re: lost data, possible playback?
| +1 vote
--On torsdag, december 06, 2007 10.41.40 -0600 Scott Marlowe So, I *must* have an image of the...
PostgreSQL - Admin
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
--On torsdag, december 06, 2007 10.41.40 -0600 Scott Marlowe
<scott.marlowe@gmail.com> wrote:

> On Dec 6, 2007 10:24 AM, Palle Girgensohn <girgen@pingpong.net> wrote:
>> Hi!
>>
>> A user accidentally deleted some results (i.e. tuples in a postgresql
>> database) created this morning.
>>
>> I have pg_xlog from about 9 o'clock until now. I have a pg_dump from ab
>> out 3 o'clock this morning.
>>
>> The results where created from about nine o'clock until noon, when the
>> user accidentally removed the results.
>>
>> Would it be possible to replay the WAL logs and get the results from
>> pg_xlog + the dump?
>
> No.
>
>> Or from a file system snapshot as of now (five pm) + pg_xlog?
>
> No.

So, I *must* have an image of the entire database, and I *must* have all
WAL files since the image snapshot was taken?

/Palle
4) Palle Girgensohn lost data, possible playback?
| +1 vote
Hi! A user accidentally deleted some results (i.e. tuples in a postgresql database) created this...
PostgreSQL - Admin
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Hi!

A user accidentally deleted some results (i.e. tuples in a postgresql
database) created this morning.

I have pg_xlog from about 9 o'clock until now. I have a pg_dump from ab out
3 o'clock this morning.

The results where created from about nine o'clock until noon, when the user
accidentally removed the results.

Would it be possible to replay the WAL logs and get the results from
pg_xlog + the dump? Or from a file system snapshot as of now (five pm) +
pg_xlog?

Regards,
Palle
5) Palle Girgensohn Re: select max(field) from table much faster with a group by clause?
| +1 vote
--On torsdag, november 01, 2007 11.34.42 -0400 Tom Lane <tgl@sss.pgh.pa.us> Estimated number of...
PostgreSQL - Performance
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
--On torsdag, november 01, 2007 11.34.42 -0400 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

> Palle Girgensohn <girgen@pingpong.net> writes:
>> --On torsdag, november 01, 2007 11.06.57 -0400 Tom Lane
>> <tgl@sss.pgh.pa.us>  wrote:
>>> Um, you did re-ANALYZE the table after changing the setting?
>
>> alter table login alter userid SET statistics 1000;
>> vacuum analyze login;
>
> Hm, that's the approved procedure all right. But the plans didn't
> change at all? Not even the estimated number of rows?

Estimated number of rows did change from ~400 to ~1900, but the timing was
the same.

Seems that the problem is that it is using an index on "when". Removing
that index (login_when_idx) changes the plan, and makes the query equally
fast whether group by is there or not. I may need the index, though, in
which one more index, on (userid, "when"), will fix the problem. I'd rather
get rid of an index than creating another one.

Anyway, I think I have two suggestions for a solution that will work for
me. I still think it is strange that the group by clause so radically
changes the behaviour and the query time.

Cheers,
Palle

pp=# \d login
                  Table "public.login"
 Column |           Type           |     Modifiers
--------+--------------------------+--------------------
 userid | text                     |
 kursid | integer                  |
 when   | timestamp with time zone |
 mode   | text                     | default 'pm'::text
Indexes:
    "login_kurs_user_idx" btree (kursid, userid)
    "login_userid_idx" btree (userid)
    "login_when_idx" btree ("when")
Foreign-key constraints:
    "pp_fk1" FOREIGN KEY (userid) REFERENCES person(userid) ON UPDATE 
CASCADE ON DELETE CASCADE
    "pp_fk2" FOREIGN KEY (kursid) REFERENCES course(id) ON UPDATE CASCADE 
ON DELETE CASCADE

spacer
Profile | Posts (66)
Home > People > Palle Girgensohn