Strange query plan
| От | Dmitry Teslenko |
|---|---|
| Тема | Strange query plan |
| Дата | |
| Msg-id | 91325fec0808140357k5bafdca5w246d38de1849fb2f@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Strange query plan
Re: Strange query plan Re: Strange query plan |
| Список | pgsql-general |
Hello!
I have following table:
CREATE TABLE table1 (
field1 INTEGER NOT NULL,
field2 INTEGER NOT NULL,
field3 CHARACTER(30),
... some more numeric fields)
I have also those indexes:
CREATE UNIQUE INDEX idx1 ON table1 USING btree (field3, field2, field1)
CREATE INDEX idx2 ON table1 USING btree (field1, field3)
Then I query this table with something like this:
SELECT SUM(...) FROM table1 WHERE field3 = 'ABC' AND field1 <> 1
GROUP BY field2
And planner picks up a sequential scan of a table. Why does he?
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
В списке pgsql-general по дате отправления: