Re: oracle to psql migration - slow query in postgres

From: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
To: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
Cc: Tony Capobianco <tcapobianco(at)prospectiv(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: oracle to psql migration - slow query in postgres
Date: 2010-10-15 15:49:20
Message-ID: AANLkTim+vgELuLpTipKiHctysTGUc8H1Ao+5GDmBBgde@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Igor Neyman 2010-10-15 17:43:40 Re: oracle to psql migration - slow query in postgres
Previous Message Tony Capobianco 2010-10-15 15:48:22 Re: oracle to psql migration - slow query in postgres

Browse pgsql-performance by date

  From Date Subject
Next Message Igor Neyman 2010-10-15 17:43:40 Re: oracle to psql migration - slow query in postgres
Previous Message Tony Capobianco 2010-10-15 15:48:22 Re: oracle to psql migration - slow query in postgres