explain analyze SELECT Person.id, rank(fti, ftq('david.wonderly')) FROM Person WHERE Person.fti @@ ftq('david.wonderly'); QUERY PLAN
-----------------------------------------------------------------------------------------------------------
Seq Scan on person (cost=0.00..44384.20 rows=5 width=54) (actual time=1123.050..1150.860 rows=1 loops=1)
Filter: ((fti)::tsvector @@ '''david'' & ''wonder'' | ''davidwond'''::tsquery)
Total runtime: 1150.917 ms
Indexes:
"person_pkey" PRIMARY KEY, btree (id) CLUSTER
"person__account__key" UNIQUE, btree (account)
"person__name__key" UNIQUE, btree (name)
"person__icon__idx" btree (icon) WHERE icon IS NOT NULL
"person__logo__idx" btree (logo) WHERE logo IS NOT NULL
"person__merged__idx" btree (merged) WHERE merged IS NOT NULL
"person__mugshot__idx" btree (mugshot) WHERE mugshot IS NOT NULL
"person__registrant__idx" btree (registrant)
"person__teamowner__idx" btree (teamowner) WHERE teamowner IS NOT NULL
"person_datecreated_idx" btree (datecreated)
"person_sorting_idx" btree (person_sort_key(displayname, name))
There is no person fti index.
Either we need to add one, or drop the fti component of this query.
explain analyze SELECT Person.id, rank(fti, ftq('david. wonderly' ))
FROM Person
WHERE Person.fti @@ ftq('david. wonderly' );
QUERY PLAN ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -- 00..44384. 20 rows=5 width=54) (actual time=1123. 050..1150. 860 rows=1 loops=1) ''::tsquery)
-------
Seq Scan on person (cost=0.
Filter: ((fti)::tsvector @@ '''david'' & ''wonder'' | ''davidwond'
Total runtime: 1150.917 ms
Indexes: _account_ _key" UNIQUE, btree (account) _name__ key" UNIQUE, btree (name) _icon__ idx" btree (icon) WHERE icon IS NOT NULL _logo__ idx" btree (logo) WHERE logo IS NOT NULL _merged_ _idx" btree (merged) WHERE merged IS NOT NULL _mugshot_ _idx" btree (mugshot) WHERE mugshot IS NOT NULL _registrant_ _idx" btree (registrant) _teamowner_ _idx" btree (teamowner) WHERE teamowner IS NOT NULL datecreated_ idx" btree (datecreated) sorting_ idx" btree (person_ sort_key( displayname, name))
"person_pkey" PRIMARY KEY, btree (id) CLUSTER
"person_
"person_
"person_
"person_
"person_
"person_
"person_
"person_
"person_
"person_
There is no person fti index.
Either we need to add one, or drop the fti component of this query.