Python: Using explain | Supabase Docs (original) (raw)
- Introduction
- Installing
- Initializing
- Database
- Fetch data
- Insert data
- Update data
- Upsert data
- Delete data
- Call a Postgres function
- Using filters
- Column is equal to a value
- Column is not equal to a value
- Column is greater than a value
- Column is greater than or equal to a value
- Column is less than a value
- Column is less than or equal to a value
- Column matches a pattern
- Column matches a case-insensitive pattern
- Column is a value
- Column is in an array
- Column contains every element in a value
- Contained by value
- Greater than a range
- Greater than or equal to a range
- Less than a range
- Less than or equal to a range
- Mutually exclusive to a range
- With a common element
- Match a string
- Match an associated value
- Don't match the filter
- Match at least one filter
- Match the filter
- Using modifiers
- Order the results
- Limit the number of rows returned
- Limit the query to a range
- Retrieve one row of data
- Retrieve zero or one row of data
- Retrieve as a CSV
- Using explain
- Auth
- Overview
- Create a new user
- Create an anonymous user
- Sign in a user
- Sign in with ID Token
- Sign in a user through OTP
- Sign in a user through OAuth
- Sign in a user through SSO
- Sign out a user
- Send a password reset request
- Verify and log in through OTP
- Retrieve a session
- Retrieve a new session
- Retrieve a user
- Update a user
- Retrieve identities linked to a user
- Link an identity to a user
- Unlink an identity from a user
- Send a password reauthentication nonce
- Resend an OTP
- Set the session data
- Exchange an auth code for a session
- Auth MFA
- Enroll a factor
- Create a challenge
- Verify a challenge
- Create and verify a challenge
- Unenroll a factor
- Get Authenticator Assurance Level
- Auth Admin
- Retrieve a user
- List all users
- Create a user
- Delete a user
- Send an email invite link
- Generate an email link
- Update a user
- Delete a factor for a user
- Edge Functions
- Invokes a Supabase Edge Function.
- Realtime
- Subscribe to channel
- Unsubscribe from a channel
- Unsubscribe from all channels
- Retrieve all channels
- Broadcast a message
- Storage
- Create a bucket
- Retrieve a bucket
- List all buckets
- Update a bucket
- Delete a bucket
- Empty a bucket
- Upload a file
- Download a file
- List all files in a bucket
- Replace an existing file
- Move an existing file
- Copy an existing file
- Delete files in a bucket
- Create a signed URL
- Create signed URLs
- Create signed upload URL
- Upload to a signed URL
- Retrieve public URL
For debugging slow queries, you can get the Postgres EXPLAIN execution plan of a query using the explain()
method. This works on any query, even for rpc()
or writes.
Explain is not enabled by default as it can reveal sensitive information about your database. It's best to only enable this for testing environments but if you wish to enable it for production you can provide additional protection by using a pre-request
function.
Follow the Performance Debugging Guide to enable the functionality on your project.
Parameters
wal
(Optional)
If `true`, include information on WAL record generation.
verbose
(Optional)
If `true`, the query identifier will be returned and `data` will include the output columns of the query.
settings
(Optional)
If `true`, include information on configuration parameters that affect query planning.
format
(Optional)
The format of the output, can be `"text"` (default) or `"json"`.
format
(Optional)
The format of the output, can be `"text"` (default) or `"json"`.
buffers
(Optional)
If `true`, include information on buffer usage.
analyze
(Optional)
If `true`, the query will be executed and the actual run time will be returned.
Examples
Get the execution plan
response = (
supabase.table("planets")
.select("*")
.explain()
.execute()
)
Get the execution plan with analyze and verbose
response = (
supabase.table("planets")
.select("*")
.explain(analyze=True, verbose=True)
.execute()
)