Full table scan perform by spanner database

140 views
Skip to first unread message

SKR

unread,
Feb 28, 2022, 3:52:27 AM2/28/22
to Google Cloud SQL discuss

We are using a query  which has multiple left outer joins which perform full table scan while running in google cloud spanner database. In which scenarios usually it performs full table scan and how to avoid it in query level?

Victoria Barbero Precedo

unread,
Mar 2, 2022, 6:06:35 AM3/2/22
to Google Cloud SQL discuss

Hi,

I found the following Official Documentation where it is explained that the scenario where a query needs to look up all the rows in a table is one of the worst cases, so in my understanding it is a practice to try to avoid and not recommended. 

Regarding your concern about how to avoid it at a query level I found this Best Practices documentation where it is explained that one way to avoid this full table scan from happening is by defining a secondary index.

I hope it helps.

Reply all
Reply to author
Forward
0 new messages