Re: [PERFORM] cannot use multicolumn index

2011-09-18 Thread Scott Marlowe
On Wed, Sep 14, 2011 at 6:50 AM, MirrorX wrote: > any ideas on how i should write to query to use this index? thx in advance You can do something like: set enable_seqscan=off; explain select yourqueryhere; and see if the plan it comes up with is any better. Use explain analyze to see how long

Re: [PERFORM] cannot use multicolumn index

2011-09-18 Thread Scott Marlowe
On Wed, Sep 14, 2011 at 6:50 AM, MirrorX wrote: > dear all, > > i have a table with (approx) 500.000.000 rows. it has several indexes, one > of which is a multicolumn index > for a column that has an id (integer) and a column that has a timestamp. i > have read in the manual that the multicolumn i

[PERFORM] cannot use multicolumn index

2011-09-18 Thread MirrorX
dear all, i have a table with (approx) 500.000.000 rows. it has several indexes, one of which is a multicolumn index for a column that has an id (integer) and a column that has a timestamp. i have read in the manual that the multicolumn index can be used only if the clauses of the query are in the

Re: [PERFORM] cannot use multicolumn index

2011-09-15 Thread MirrorX
thank you all for your advice. i will try the table partitioning approach to reduce the size of the tables and to be able to handle them more efficiently -- View this message in context: http://postgresql.1045698.n5.nabble.com/cannot-use-multicolumn-index-tp4802634p4806239.html Sent from the Post

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread Tomas Vondra
On 14 Září 2011, 17:14, MirrorX wrote: > thx for the answer. > > - What is the problem, i.e. what behaviour you expect? > - How much data is the table? > - What portion of it matches the conditions? > - What is the index definition? > > i think in my first post i provided most of these details but

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread Vitalii Tymchyshyn
14.09.11 18:14, MirrorX написав(ла): i think in my first post i provided most of these details but -> 1) what i expect is to be able to understand why the index is not used and if possibly to use it somehow, or recreate it in a better way 2) the table has 115 GB and about 700 milion rows 3) the r

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread MirrorX
thx for the answer. - What is the problem, i.e. what behaviour you expect? - How much data is the table? - What portion of it matches the conditions? - What is the index definition? i think in my first post i provided most of these details but -> 1) what i expect is to be able to understand why

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread Tomas Vondra
On 14 Září 2011, 15:09, MirrorX wrote: > here is the explain analyze output-> > server=# explain analyze select count(*) from temp_by_hour where xid > 100 > and xdate > now() - interval '1 week'; > QUERY > PLAN > --

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread MirrorX
-postgres version -> 8.4.4 -os -> redhat 5.6 -specs ->24 cores, 96GB ram, shared_buffers=32 GB -postgresql.conf -> i havent made any changes as far as the query tuning parameters are concerned. #-- # QUERY TUNING #-

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread Grzegorz Jaśkiewicz
http://wiki.postgresql.org/wiki/Guide_to_reporting_problems -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] cannot use multicolumn index

2011-09-14 Thread MirrorX
here is the explain analyze output-> server=# explain analyze select count(*) from temp_by_hour where xid > 100 and xdate > now() - interval '1 week'; QUERY PLAN