Re: [PERFORM] which one is faster

2010-10-26 Thread Marcin Mirosław
W dniu 26.10.2010 12:59, Szymon Guz pisze: > both queries are the same. IMHO they aren't the same, but they returns the same value in this case. I mean count(field) doesn't count NULL values, count(*) does it. I'm writing this only for note:) Regards -- Sent via pgsql-performance mailing list (p

Re: [PERFORM] Any experience using "shake" defragmenter?

2011-01-30 Thread Marcin Mirosław
W dniu 2011-01-30 22:31, Mark Felder pisze: > Why do you feel the need to defrag your *nix box? I'm guessing, maybe he used filefrag and saw >3 extents? :) Next question will be "which fs do you use?" and then flame will start:( Regards -- Sent via pgsql-performance mailing list (pgsql-perfo

Re: [PERFORM] : Performance Improvement Strategy

2011-09-20 Thread Marcin Mirosław
W dniu 2011-09-20 18:22, Venkat Balaji pisze: > Hello Everyone, > > I had posted a query in "GENERAL" category, not sure if that was the > correct category to post. > > Please help me understand how to calculate free space in Tables and > Indexes even after vacuuming and analyzing is performed.

Re: [PERFORM] partitioned table: differents plans, slow on some situations

2011-12-30 Thread Marcin Mirosław
W dniu 30.12.2011 17:01, Matteo Sgalaberni pisze: > Hi, Hello, > I have a two tables that are partitioned by month. > > I have different results for the same query (query A/query B), the only thing > that differ from A and B is the customer id. Not only: > Query A: > > SELECT sms.id AS id_sm

[PERFORM] [planner] Ignore "order by" in subselect if parrent do count(*)

2012-03-01 Thread Marcin Mirosław
Hello, my example query (and explain) is: $ explain SELECT count(*) from (select * from users_profile order by id) u_p; QUERY PLAN --- Aggregate (cost=1.06..1.07 rows=1 width=0) -> Sort (c

Re: [PERFORM] [planner] Ignore "order by" in subselect if parrent do count(*)

2012-03-01 Thread Marcin Mirosław
W dniu 01.03.2012 12:50, Szymon Guz pisze: Hi Szymon, > If you have only 2 rows in the table, then the plan really doesn't > matter too much. Sorting two rows would be really fast :) > > Try to check it with 10k rows. It doesn't matter (in this case) how many records is in user_profile table. Pla

Re: [PERFORM] [planner] Ignore "order by" in subselect if parrent do count(*)

2012-03-01 Thread Marcin Mirosław
W dniu 01.03.2012 13:09, Szymon Guz pisze: > Could you provide the postgres version and the structure of > users_profile table (with indexes)? Argh, i forgot about version. It's postgresql-9.1.3. I don't think structre of users_profile is important here. Me idea is let planner ignore sorting compl

Re: [PERFORM] Optimize update query

2012-11-28 Thread Marcin Mirosław
W dniu 28.11.2012 15:07, Shaun Thomas pisze: > On 11/28/2012 06:57 AM, Niels Kristian Schjødt wrote: > > Before I go crazy, here... you really need to tell us what "not enough" > means. You didn't provide an explain analyze, so we don't know what your > actual performance is. But I have my suspici