Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Alan Hodgson
On Friday 24 October 2008, "Grzegorz Jaśkiewicz" <[EMAIL PROTECTED]> wrote: > with two sata discs in software raid 1 on linux. And it seems to spend > loads of time (40-60% sometimes) on waits. I guess this is due to lack of > >aio support in postgresql, No, it's due to the fact that hard disks

Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Grzegorz Jaśkiewicz
that index did the job, also reindexing, and getting rid of two other not quite often used indices helped a lot. Now, this whole machine is fairly simple two way p4, with two sata discs in software raid 1 on linux. And it seems to spend loads of time (40-60% sometimes) on waits. I guess this is du

Re: [GENERAL] max time in a table query takes ages

2008-10-24 Thread Scott Ribe
> Can postgres use combined indicies for queries that would only require part of > it ? Even if not, if there is at least one index that reduces the potential matches to a small set, then scanning those rows against the other criteria won't take so long. (Assuming good stats and PG choosing a goo

Re: [GENERAL] max time in a table query takes ages

2008-10-23 Thread Grzegorz Jaśkiewicz
On Thu, Oct 23, 2008 at 2:47 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > > > I suppose the problem is that rows with processed = false are very few > in the upper range of data. If so, and if you really need this to go > fast, a partial index might be worth its overhead: >create index foo o

Re: [GENERAL] max time in a table query takes ages

2008-10-23 Thread Tom Lane
"=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?=" <[EMAIL PROTECTED]> writes: > I have a simple query over a fairly simple query here, that scans for max > date in a table that's fairly hudge (300M rows). there's index on that field > that's being used, but for whatever reason, it takes ages. Ideas ? > sele

Re: [GENERAL] max time in a table query takes ages

2008-10-23 Thread Grzegorz Jaśkiewicz
if reindex will help (which I will run overnight, and will let you know Tomorrow) - I find it quite worrying, cos it is 8.3, and I was hoping - with HOT in place, and all these features - that reindexing of that table wouldn't be needed. it is 'only' 375M rows now, but I can definetively feel pain

Re: [GENERAL] max time in a table query takes ages

2008-10-23 Thread Pavel Stehule
Hello try VACUUM and REINDEX regards Pavel Stehule 2008/10/23 Grzegorz Jaśkiewicz <[EMAIL PROTECTED]>: > hey folks > > I have a simple query over a fairly simple query here, that scans for max > date in a table that's fairly hudge (300M rows). there's index on that field > that's being used, but