Re: [PERFORM] select count(*) from anIntColumn where int_value = 0;

2004-02-11 Thread scott.marlowe
On Wed, 11 Feb 2004, David Teran wrote: > Hi, > > > Is your int_value data type int4? If not then use "... from > > job_property > > where int_value = '0'" > > Indexes are used only if datatypes matches. > > > tried those variations already. Strange enough, after dropping and > recreating the i

Re: [PERFORM] select count(*) from anIntColumn where int_value = 0;

2004-02-11 Thread Christopher Browne
Oops! [EMAIL PROTECTED] (Pavel Stehule) was seen spray-painting on a wall: > > Regards > Pavel Stehule > > On Wed, 11 Feb 2004, David Teran wrote: > >> Hi >> >> we have a table with about 4 million rows. One column has an int value, >> there is a btree index on it. We tried to execute the followi

Re: [PERFORM] select count(*) from anIntColumn where int_value = 0; is very slow

2004-02-11 Thread PC Drew
Had you done a VACUUM ANALYZE at all? There has been much discussion lately about the planner needing to be updated to know that the index is a better choice. On Feb 11, 2004, at 6:32 AM, David Teran wrote: Hi, Is your int_value data type int4? If not then use "... from job_property where in

Re: [PERFORM] select count(*) from anIntColumn where int_value = 0; is very slow

2004-02-11 Thread David Teran
Hi, Is your int_value data type int4? If not then use "... from job_property where int_value = '0'" Indexes are used only if datatypes matches. tried those variations already. Strange enough, after dropping and recreating the index everything worked fine. regards David ---

Re: [PERFORM] select count(*) from anIntColumn where int_value = 0; is very slow

2004-02-11 Thread Rigmor Ukuhe
> > Hi > > we have a table with about 4 million rows. One column has an int value, > there is a btree index on it. We tried to execute the following > statement and it is very slow on a dual G5 2GHZ with 4 GB of RAM. > > explain analyze select count(*) from job_property where int_value = 0; > > Ag

Re: [PERFORM] select count(*) from anIntColumn where int_value = 0;

2004-02-11 Thread Pavel Stehule
Hello, If you has index on id, then you can use SELECT id FROM tabulka ORDER BY id DESC LIMIT 1; See 4.8. FAQ Regards Pavel Stehule On Wed, 11 Feb 2004, David Teran wrote: > Hi > > we have a table with about 4 million rows. One column has an int value, > there is a btree index on it. We t

[PERFORM] select count(*) from anIntColumn where int_value = 0; is very slow

2004-02-11 Thread David Teran
Hi we have a table with about 4 million rows. One column has an int value, there is a btree index on it. We tried to execute the following statement and it is very slow on a dual G5 2GHZ with 4 GB of RAM. explain analyze select count(*) from job_property where int_value = 0; Aggregate (cost=1