Re: [PERFORM] index questions

2003-07-25 Thread Franco Bruno Borghesi
what you say is that the index is not effective because of its size, but it would still be used *if* the conditions are right... In this case, I care about performance, not space. But what you say about the index not being good because 100% of rows match the condition confirms what I suspecte

Re: [PERFORM] index questions

2003-07-25 Thread Josh Berkus
Franco, > CREATE INDEX sales_k1 ON sales(clientId, branchId, productId, > employeeId, saleDate, price, qty); A 7-column index is unlikely to be effective -- the index will be almost as large as the table. Try indexing only the first 3-4 columns instead. > I want to make a function that retu

Re: [PERFORM] index questions

2003-07-25 Thread Ron Johnson
On Fri, 2003-07-25 at 11:52, Franco Bruno Borghesi wrote: [snip] > > > Will findSale() in the future, when I have *many* rows still use the > index when only the first couple of > arguments are passed to the function? > If not, should I create more indexes (and functions) for each possible > argu

[PERFORM] index questions

2003-07-25 Thread Franco Bruno Borghesi
Hi everyone. I have created a simplified example of a real case, to show you what I'm tryng to do. I have a table, like this: CREATE TABLE sales (    saleId SERIAL,    clientId INTEGER,    branchId INTEGER,    productId INTEGER,    employeeId INTEGER,    saleDate DATE,    price NUMERIC(12, 2)