From: | "A(dot)j(dot) Langereis" <a(dot)j(dot)langereis(at)inter(dot)nl(dot)net> |
---|---|
To: | "Postgres general mailing list" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Difference in indexes |
Date: | 2005-11-22 00:04:34 |
Message-ID: | 02d101c5eef8$52a2d3b0$3e01a8c0@aarjan2 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Tnks Qingqing, I've read them! Nevertheless I think there are some
differences here:
* The difference in the amout of rows is much smaller. Nevertheless the
table is small as well: only 100 rows
* There is a faster query plan to solve the query:
"Bitmap Heap Scan on hosts (cost=2.07..11.34 rows=21 width=59) (actual
time=0.175..0.287 rows=21 loops=1)"
" Recheck Cond: ((hostname)::text = 'Fabian'::text)"
" -> Bitmap Index Scan on hosts_hostname (cost=0.00..2.07 rows=21
width=0) (actual time=0.145..0.145 rows=21 loops=1)"
" Index Cond: ((hostname)::text = 'Fabian'::text)"
"Total runtime: 0.510 ms"
This result was achieved by setting enable_seqscan to off (postgresql.conf).
Turning off enable_bitmapscan as well resulted in a index scan which was
even more faster:
"Index Scan using hosts_hostname on hosts (cost=0.00..37.28 rows=21
width=59) (actual time=0.068..0.281 rows=21 loops=1)"
" Index Cond: ((hostname)::text = 'Fabian'::text)"
"Total runtime: 0.492 ms"
Yours,
Aarjan
----- Original Message -----
From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, November 22, 2005 12:38 AM
Subject: Re: [GENERAL] Difference in indexes
>
> ""A.j. Langereis"" <a(dot)j(dot)langereis(at)inter(dot)nl(dot)net> wrote
> >
> > What is happening here? What am I overlooking? The length does not
> > seem to be the problem: 'FooFooFoo' also uses the index..
> > Also the fact whenever there are results or not does not seem to
> > influence the planner..
> >
>
> Check out this thread:
>
> http://archives.postgresql.org/pgsql-bugs/2005-11/msg00032.php
>
> Regards,
> Qingqing
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Guy Rouillier | 2005-11-22 00:25:55 | Re: Group By? |
Previous Message | Bob Pawley | 2005-11-21 23:53:15 | Group By? |