Re: [PERFORM] Using Gprof with Postgresql

2009-09-08 Thread Reydan Cankur
I just compiled it with gcc and produces the gmon.out file for every process; by the way I am running below script in order to produce readable .out files gprof .../pgsql/bin/postgres gmon.out > createtable2.out is postgres the right executable? regards reydan On Sep 7, 2009, at 8:24 PM,

Re: [PERFORM] Using Gprof with Postgresql

2009-09-08 Thread Reydan Cankur
I just compiled it with gcc and produces the gmon.out file for every process; by the way I am running below script in order to produce readable .out files gprof .../pgsql/bin/postgres gmon.out > createtable2.out is postgres the right executable? regards reydan On Sep 7, 2009, at 8:24

Re: [PERFORM] Using Gprof with Postgresql

2009-09-08 Thread Pierre Frédéric Caillau d
I just compiled it with gcc and produces the gmon.out file for every process; by the way I am running below script in order to produce readable .out files gprof .../pgsql/bin/postgres gmon.out > createtable2.out is postgres the right executable? regards reydan Off topic, but hac

Re: [PERFORM] Using Gprof with Postgresql

2009-09-08 Thread Craig James
Pierre Frédéric Caillaud wrote: I just compiled it with gcc and produces the gmon.out file for every process; by the way I am running below script in order to produce readable .out files gprof .../pgsql/bin/postgres gmon.out > createtable2.out is postgres the right executable? regards reyd

[PERFORM] Forcing postgresql to use an index

2009-09-08 Thread Eugene Morozov
Hello, I have a following query (autogenerated by Django) SELECT activity_activityevent.id, activity_activityevent.user_id, activity_activityevent.added_on FROM activity_activityevent WHERE activity_activityevent.user_id IN ( SELECT U0.user_id FROM profile U0 INNER JOIN profile_frien

Re: [PERFORM] Forcing postgresql to use an index

2009-09-08 Thread Grzegorz Jaśkiewicz
Learn it to not generate with "WITH IN (subq)", is this can be quite slow on postgresql. Use joins instead. looks like planner was wrong about rowcount in one place: Hash IN Join (cost=2204.80..4809.31 rows=292 width=202) (actual time=12.856..283.916 rows=15702 loops=1) I have no idea why, proba

Re: [PERFORM] Forcing postgresql to use an index

2009-09-08 Thread Kevin Grittner
Eugene Morozov wrote: > Can anyone enlighten me? Should I set random_page_cost to 1.2 > permanently (I feel this is not a really good idea in my case)? For it to pass as many rows as it did in the time that it did, most or all of the "reads" were cached. If this is typically the case, at lea

Re: [PERFORM] Forcing postgresql to use an index

2009-09-08 Thread Scott Marlowe
On Tue, Sep 8, 2009 at 8:12 AM, Eugene Morozov wrote: > Hello, > > I have a following query (autogenerated by Django) > > SELECT activity_activityevent.id, activity_activityevent.user_id, > activity_activityevent.added_on > FROM activity_activityevent > WHERE activity_activityevent.user_id IN ( >

Re: [PERFORM] [sfpug] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
On Tue, Sep 08, 2009 at 10:30:21AM -0700, David Fetter wrote: > Folks, > > For those of you who can't attend in person, we'll be streaming audio > and video and having a chat for tonight's SFPUG meeting on how the > planner uses statistics. > > Video: > > http://media.postgresql.org/sfpug/stream

[PERFORM] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
Folks, For those of you who can't attend in person, we'll be streaming audio and video and having a chat for tonight's SFPUG meeting on how the planner uses statistics. Video: http://media.postgresql.org/sfpug/streaming Chat: irc://irc.freenode.net/sfpug Cheers, David. -- David Fetter http:

[PERFORM] Re: [GENERAL] [sfpug] Statistics and PostgreSQL: Streaming Webcast tonight

2009-09-08 Thread David Fetter
On Tue, Sep 08, 2009 at 10:32:53AM -0700, David Fetter wrote: > On Tue, Sep 08, 2009 at 10:30:21AM -0700, David Fetter wrote: > > Folks, > > > > For those of you who can't attend in person, we'll be streaming audio > > and video and having a chat for tonight's SFPUG meeting on how the > > planner

[PERFORM] partitioning max() sql not using index

2009-09-08 Thread Kevin Kempter
Hi all I have a large table (>2billion rows) that's partitioned by date based on an epoch int value. We're running a select max(id) where id is the PK. I have a PK index on each of the partitions, no indexes at all on the base table. If I hit a partition table directly I get an index scan as e

Re: [PERFORM] Forcing postgresql to use an index

2009-09-08 Thread Eugene Morozov
Scott Marlowe writes: > On Tue, Sep 8, 2009 at 8:12 AM, Eugene Morozov wrote: > OK, you need to look a little deeper at what's happening here. The > pgsql query planner looks at a lot of things to decide if to use seq > scan or and index. If you look at your row estimates versus actual > rows r