From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | Szabo Zoltan <col(at)mportal(dot)hu> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: index problem |
Date: | 2001-10-16 20:05:14 |
Message-ID: | Pine.BSF.4.21.0110161302590.17549-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Mon, 15 Oct 2001, Szabo Zoltan wrote:
> Hi,
>
> I have that:
>
> 1)
> db=> explain select pxygy_pid from prog_dgy_xy where pxygy_pid=12121;
> NOTICE: QUERY PLAN:
>
> Group (cost=0.00..29970.34 rows=921 width=4)
> -> Index Scan using progdgyxy_idx2 on prog_dgy_xy
> (cost=0.00..29947.32 rows=9210 width=4)
>
> than:
> 2)
> db=> explain select pxygy_pid from prog_dgy_xy where pxygy_pid>12121;
> NOTICE: QUERY PLAN:
>
> Group (cost=66927.88..67695.39 rows=30700 width=4)
> -> Sort (cost=66927.88..66927.88 rows=307004 width=4)
> -> Seq Scan on prog_dgy_xy (cost=0.00..32447.66 rows=307004
> width=4)
>
> I making some banchmarks on: oracle vs postgres vs mysql. And this is
> breaking me now;) Mysql and oracle width same table and index use that
> index on pxygy_pid;
> I had vacuum before.
I assume you mean you did a vacuum analyze (a plain vacuum isn't
sufficient). If you did just do a regular vacuum, do a vacuum analyze
to get the updated statistics.
How many rows actually match pxygy_pid>12121? Is 307000 rows a reasonable
estimate? How many rows are in the table?
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2001-10-16 20:13:25 | Re: VARCHAR vs TEXT |
Previous Message | Stephan Szabo | 2001-10-16 20:02:30 | Re: Triggers do not fire |