Re: [PERFORM] one-field index vs. multi-field index planner

2006-03-10 Thread Tom Lane
Evgeny Gridasov <[EMAIL PROTECTED]> writes: > ofcourse I've analyzed it. > visible is true for about 0.3% of all rows. Well, I get an indexscan on i3 ... there isn't going to be any strong reason for the planner to prefer i2 over i1, given that the phone column is probably near-unique and the i2 i

Re: [PERFORM] one-field index vs. multi-field index planner

2006-03-10 Thread Evgeny Gridasov
Tom, ofcourse I've analyzed it. visible is true for about 0.3% of all rows. testing table contains about 300,000-500,000 rows. On Fri, 10 Mar 2006 12:09:19 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Evgeny Gridasov <[EMAIL PROTECTED]> writes: > > Recently I've discovered an interesting thing (P

Re: [PERFORM] one-field index vs. multi-field index planner estimates

2006-03-10 Thread Tom Lane
Evgeny Gridasov <[EMAIL PROTECTED]> writes: > Recently I've discovered an interesting thing (Postgres version 8.1.3): Have you ANALYZEd the table since loading it? What fraction of the rows have visible = true? regards, tom lane ---(end of broadca

[PERFORM] one-field index vs. multi-field index planner estimates

2006-03-10 Thread Evgeny Gridasov
Hello. Recently I've discovered an interesting thing (Postgres version 8.1.3): example table: CREATE TABLE test ( id INT, name TEXT, comment TEXT, phone TEXT, visible BOOLEAN ); then, CREATE INDEX i1 ON test(phone); CREATE INDEX i2 ON test(phone, visible); CREATE INDEX i3 ON test(phone, vi