Re: oracle to psql migration - slow query in postgres - Mailing list pgsql-performance

From Maciek Sakrejda
Subject Re: oracle to psql migration - slow query in postgres
Date
Msg-id AANLkTim+vgELuLpTipKiHctysTGUc8H1Ao+5GDmBBgde@mail.gmail.com
Whole thread Raw
In response to Re: oracle to psql migration - slow query in postgres  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
List pgsql-performance
>> This table has approximately 300million rows.
>
> and your query grab rows=236 660 930 of them. An index might be
> useless in this situation.

I want to point out that this is probably the most important comment
here. A couple of people have noted out that the index won't work for
this query, but more importantly, an index is (probably) not desirable
for this query. As an analogy (since everyone loves half-baked
programming analogies), if you want to find a couple of bakeries to
sponsor your MySQL Data Integrity Issues Awareness Walk by donating
scones, you use the yellow pages. If you want to hit up every business
in the area to donate whatever they can, you're better off canvasing
the neighborhood.
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

pgsql-performance by date:

Previous
From: Tony Capobianco
Date:
Subject: Re: oracle to psql migration - slow query in postgres
Next
From: Mladen Gogala
Date:
Subject: Re: Slow count(*) again...