Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 278810

All versions of PostgreSQL. Add an additional version-specific tag like [postgresql-13] if that context is relevant.

0 votes
1 answer
144 views

Why did the number of live rows fetched by index scans drop after table ANALYZE?

We use PostgreSQL 12 and have a simple table, event_participant, storing 100 GBs of data. event_participant has all the necessary indexes, so all rows are fetched using them, i.e., no rows are fetched …
Milan Ilic's user avatar
2 votes
Accepted

Why did the number of live rows fetched by index scans drop after table ANALYZE?

; PostgreSQL used event_participant_event_id_idx to fetch all rows with event_id=tour2023 and then filter desired row by user_id instead of using the composite index "event_participant_pkey" PRIMARY KEY … I'm still missing part of why PostgreSQL used the (event_id) index only, as I expected the query planner to favor the composite index when both user_id and event_id are specified in the query. …
Milan Ilic's user avatar