From: | Chris <dmagick(at)gmail(dot)com> |
---|---|
To: | Chris Velevitch <chris(dot)velevitch(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Fwd: Which indexes does a query use? |
Date: | 2006-02-27 01:01:51 |
Message-ID: | 44024F7F.3000204@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Chris Velevitch wrote:
> On 2/27/06, Russell Smith <mr-russ(at)pws(dot)com(dot)au> wrote:
>
>>Not necessarily. How many rows are there in the table at the moment.
>>If pg uses and index, it first has to get the index page, then get the
>>heap page. So if you have a small number of blocks in the heap it's
>>actually cheaper to just scan the heap. I would guess the heap is small
>>by the fact that the seq scan only find one row, and finds it in 46.32
>>units. The row width isn't high either and that means you get good
>>block packing. Probably 80-100 row's per block.
>
> It's about 200 records.
>
> Are you saying that the strategy pg uses is dynamic, in that as the
> size of the table grows the strategy changes?
Yes, it does.
For 200 rows, it's just as quick for it to look at every row. If you
have 20,000 - then that's a different case.
--
Postgresql & php tutorials
http://www.designmagick.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Ken Winter | 2006-02-27 02:58:54 | Re: Another perplexity with PG rules |
Previous Message | Chris Velevitch | 2006-02-27 00:57:40 | Fwd: Which indexes does a query use? |