Re: [GENERAL] sql indexing suggestions needed

2007-03-21 Thread Angva
On Mar 20, 2:54 pm, [EMAIL PROTECTED] (Jonathan Vanasco) wrote: > can anyone suggest an indexing approach that might get pg to use the > indexes ? this is driving me crazy. Have you tried an expression-based index? http://www.postgresql.org/docs/8.1/interactive/indexes-expressional.html I'm assu

[GENERAL] sql indexing suggestions needed

2007-03-21 Thread Jonathan Vanasco
i'm going crazy trying to optimize this select. The table has ~25 columns, the select is based on 10. There are approx 5 million records in the table and growing. No matter how I index + analyze this table, including making an index of every related column on the search, pg keeps doing a

Re: [GENERAL] sql indexing suggestions needed

2007-03-20 Thread Jonathan Vanasco
On Mar 20, 2007, at 3:24 PM, Ron Johnson wrote: How many *distinct* values are there in int_c? What percentage of them match "int_c <= 10"? right now there are 14, and 80% match -- but next week that number will be 20 , 60% ... and so on Same questions, but for int_h. same answer If i

Re: [GENERAL] sql indexing suggestions needed

2007-03-20 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/20/07 14:11, Jonathan Vanasco wrote: > > On Mar 20, 2007, at 2:54 PM, Jonathan Vanasco wrote: > >> No matter how I index + analyze this table, including making an index >> of every related column on the search, pg keeps doing a sequential >> sc

Re: [GENERAL] sql indexing suggestions needed

2007-03-20 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/20/07 13:54, Jonathan Vanasco wrote: > i'm going crazy trying to optimize this select. > > The table has ~25 columns, the select is based on 10. There are approx > 5 million records in the table and growing. > > No matter how I index + analyz

Re: [GENERAL] sql indexing suggestions needed

2007-03-20 Thread Jonathan Vanasco
On Mar 20, 2007, at 2:54 PM, Jonathan Vanasco wrote: No matter how I index + analyze this table, including making an index of every related column on the search, pg keeps doing a sequential scan and never includes an index -- which takes ~2minutes to do. I really need to cut this down.

Re: [GENERAL] sql indexing suggestions needed

2007-03-20 Thread Benjamin Arai
I wonder if converting all of your bools to a bit string and storing that string as a number would make things faster? Benjamin On Mar 20, 2007, at 11:54 AM, Jonathan Vanasco wrote: i'm going crazy trying to optimize this select. The table has ~25 columns, the select is based on 10. There

[GENERAL] sql indexing suggestions needed

2007-03-20 Thread Jonathan Vanasco
i'm going crazy trying to optimize this select. The table has ~25 columns, the select is based on 10. There are approx 5 million records in the table and growing. No matter how I index + analyze this table, including making an index of every related column on the search, pg keeps doing a