From: | "Tyler Durden" <tylersticky(at)gmail(dot)com> |
---|---|
To: | "John D(dot) Burger" <john(at)mitre(dot)org> |
Cc: | "PostgreSQL General" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Seq Scan |
Date: | 2007-06-01 17:17:12 |
Message-ID: | ab07320e0706011017u55ceacd8tb428b89128a53975@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Yes, either case happens the same.
I'm come recently from MySQL and it works in a different way.
I find strange that a simple SELECT COUNT(...) is so slow with only
700 000 records.
Has been a nightmare optimizing this tables/queries.
Sorry about this silly question, but I'm new to Posgresql.
Thanks,
Tyler
On 6/1/07, John D. Burger <john(at)mitre(dot)org> wrote:
> You mention SELECT COUNT(ID), but your example shows SELECT ID. In
> either case, the planner is choosing the correct plan. Indexes exist
> to save the engine from visiting every row in the table, but both of
> these queries require every row to be visited anyway.
>
> Perhaps you think that these queries can be satisfied without
> visiting the actual table rows at all, using only the index. This is
> incorrect - PG doesn't work that way.
>
> - John Burger
> MITRE
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
From | Date | Subject | |
---|---|---|---|
Next Message | Joshua D. Drake | 2007-06-01 17:21:08 | Looking for Graphical people for PostgreSQL tradeshow signage |
Previous Message | Mike Ginsburg | 2007-06-01 17:11:59 | Interval Rounding |