Re: [SQL] How to force PostgreSQL using an index

2006-02-16 Thread Daniel Caune
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : mercredi, février 15, 2006 17:47 > À : Daniel Caune > Cc : Andrew Sullivan; pgsql-sql@postgresql.org > Objet : Re: [SQL] How to force PostgreSQL using an index > > "Daniel

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
> "Owen Jacobson" <[EMAIL PROTECTED]> writes: > > On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > >> I see, but that doesn't explain whether it is possible to specify the > >> index to use. It seems that those options just force PostgreSQL using > >> another plan. > > > Drop the

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Tom Lane
"Owen Jacobson" <[EMAIL PROTECTED]> writes: > On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: >> I see, but that doesn't explain whether it is possible to specify the >> index to use. It seems that those options just force PostgreSQL using >> another plan. > Drop the simple index an

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
> > > > Is there a way to force PostgreSQL using an index for a SELECT > > > > statement? > > > > > > Your best bet is to do > > > > > > set enable_indexscan=false; > > > > > > and then do the EXPLAIN ANALYSE for your select. > > > > I see, but that doesn't explain whether it is possible to speci

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Tom Lane
"Daniel Caune" <[EMAIL PROTECTED]> writes: > SELECT > FROM GSLOG_EVENT > WHERE EVENT_NAME = 'player-status-update' > AND EVENT_DATE_CREATED >= > AND EVENT_DATE_CREATED < > I have an index on EVENT_DATE_CREATED that does it job. But I though > that I can help my favourite PostgreSQL

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Andrew Sullivan
On Wed, Feb 15, 2006 at 05:26:57PM -0500, Daniel Caune wrote: > I have an index on EVENT_DATE_CREATED that does it job. But I though > that I can help my favourite PostgreSQL if I create a composite index on > EVENT_DATE_CREATED and EVENT_NAME (in that order as EVENT_DATE_CREATED > is more dense t

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Owen Jacobson
Daniel Caune wrote: > > Andrew Sullivan wrote: > > > On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > > > > > > > > Is there a way to force PostgreSQL using an index for a SELECT > > > statement? > > > > Your best bet is to do > > > > set enable_indexscan=false; > > > > and then

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
> On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > > Hi, > > > > > > > > Is there a way to force PostgreSQL using an index for a SELECT > > statement? I just want to confirm that the index PostgreSQL decides to > > use is better than the index I supposed PostgreSQL would use (I alr

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Owen Jacobson
dling the cpu_index_tuple_cost option. - Owen (Apologies for the Outlookism.) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Daniel Caune Sent: Wednesday, February 15, 2006 1:59 PM To: pgsql-sql@postgresql.org Subject: [SQL] How to force PostgreSQL usi

Re: [SQL] How to force PostgreSQL using an index

2006-02-15 Thread Andrew Sullivan
On Wed, Feb 15, 2006 at 04:58:54PM -0500, Daniel Caune wrote: > Hi, > > > > Is there a way to force PostgreSQL using an index for a SELECT > statement? I just want to confirm that the index PostgreSQL decides to > use is better than the index I supposed PostgreSQL would use (I already > analyz

[SQL] How to force PostgreSQL using an index

2006-02-15 Thread Daniel Caune
Hi,   Is there a way to force PostgreSQL using an index for a SELECT statement?  I just want to confirm that the index PostgreSQL decides to use is better than the index I supposed PostgreSQL would use (I already analyze the table).   Regards,   -- Daniel CAUNE Ubisoft Online Techno