| From: | Gaetano Mendola <mendola(at)bigfoot(dot)com> |
|---|---|
| To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Subject: | Re: ways to force index use? |
| Date: | 2003-10-14 00:20:40 |
| Message-ID: | 3F8B4158.2030600@bigfoot.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers pgsql-performance |
Tom Lane wrote:
> Seth Ladd <seth(at)picklematrix(dot)net> writes:
>
>>My Table Columns (all bigints): start, stop, step1, step2, step3
>
> ^^^^^^^^^^^
>
>
>>The Query: explain analyze select * from path where start = 653873 or
>>start = 649967 or stop = 653873 or stop = 649967
>
>
>>Does anyone have a suggestion on how to get that query to use an index?
>
>
> Coerce the constants to bigint, for starters. However, a query that is
> selecting almost 10% of the table, as your example is, probably
> *shouldn't* be using an index.
I think that for 10% is still better and Index scan.
There is around a way to calculate this elbow ?
Regards
Gaetano Mendola
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2003-10-14 00:27:01 | Re: Heading to final release |
| Previous Message | Rod Taylor | 2003-10-14 00:11:08 | Re: 2-phase commit |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2003-10-14 00:48:13 | Re: [HACKERS] Sun performance - Major discovery! |
| Previous Message | Tom Lane | 2003-10-14 00:11:55 | Re: go for a script! / ex: PostgreSQL vs. MySQL |