[GENERAL] Problem Designing Index

2007-08-17 Thread Alan J Batsford
Hello, I'm doing some select statements on my table that look like: SELECT * FROM table WHERE prod_num = '1234567' AND transaction_timestamp > '2007-07-18 21:29:57' OR prod_num > '1234567' ORDER BY prod_num ASC, transaction_timestamp ASC LIMIT 1; I've added two indices one for prod_num and anoth

Re: [GENERAL] Problem Designing Index

2007-08-13 Thread Gregory Stark
"Alan J Batsford" <[EMAIL PROTECTED]> writes: > Thanks for the help, after your email I went to capture some analyze output > for you and when I did I figured to bump up the statistics on the two > columns of interest from 100 to 1000. Now all statements return close to > instantly. Note that 100

Re: [GENERAL] Problem Designing Index

2007-08-13 Thread Alan J Batsford
[EMAIL PROTECTED] wrote on 08/13/2007 08:36:23 AM: > While it's difficult to be sure, I'm guessing you have either a hardware > problem, or a tuning problem -- but I don't think your indexes are a problem. > > Keep in mind that once PostgreSQL has determined which rows to return, it > has to actua

Re: [GENERAL] Problem Designing Index

2007-08-13 Thread Bill Moran
In response to Alan J Batsford <[EMAIL PROTECTED]>: > > Hello, > > I'm doing some select statements on my table that look like: > SELECT * FROM table WHERE prod_num = '1234567' AND transaction_timestamp > > '2007-07-18 21:29:57' OR prod_num > '1234567' ORDER BY prod_num ASC, > transaction_timesta

[GENERAL] Problem Designing Index

2007-08-13 Thread Alan J Batsford
Hello, I'm doing some select statements on my table that look like: SELECT * FROM table WHERE prod_num = '1234567' AND transaction_timestamp > '2007-07-18 21:29:57' OR prod_num > '1234567' ORDER BY prod_num ASC, transaction_timestamp ASC LIMIT 1; I've added two indices one for prod_num and anot