Re: sequential scans and the like operator
От | Dave Trombley |
---|---|
Тема | Re: sequential scans and the like operator |
Дата | |
Msg-id | 3C3B4312.5020805@bumba.net обсуждение исходный текст |
Ответ на | sequential scans and the like operator ("Roderick A. Anderson" <raanders@tincan.org>) |
Ответы |
Re: sequential scans and the like operator
Re: sequential scans and the like operator |
Список | pgsql-general |
Roderick A. Anderson wrote: >There is a discussion going on on the sql-ledger mailing list concerning >whether indexes will provide any performance improvements. The one that >caught my eye was whether using LIKE in a statement would force a >sequential scan. > You can always check exaclty what's being done in your queries by using the EXPLAIN command. For example, to test your hypothesis: ------------------ test=# create table foo(f text, i int); CREATE test=# create index foo_t on foo (f); CREATE test=# explain select * from foo where f like '%uiop%'; NOTICE: QUERY PLAN: Seq Scan on foo (cost=0.00..22.50 rows=1 width=36) EXPLAIN test=# explain select * from foo where f = '%uiop%'; NOTICE: QUERY PLAN: Index Scan using foo_t on foo (cost=0.00..17.07 rows=5 width=36) EXPLAIN --------------------- -dj trombley <dtrom@bumba.net>
В списке pgsql-general по дате отправления: