cockroachdb / docs

CockroachDB user documentation
https://cockroachlabs.com/docs
Creative Commons Attribution 4.0 International
190 stars 459 forks source link

Update SQL performance best practices mention of AOST to recommend interval to use #5897

Open rmloveland opened 5 years ago

rmloveland commented 5 years ago

Richard Loveland (rmloveland) commented:

Our SQL performance best practices page says to use AS OF SYSTEM TIME to decrease conflicts with long-running queries.

However, it doesn't answer the question:

how far back in time roughly should the query be run to get good performance?

If you have an enterprise license, we should recommend you use experimental_follower_reads_timestamp().

If you do not, we should recommend you run it about this far back:

> select now() - experimental_follower_read_timestamp();

?column?      
+-----------------+
  00:00:47.999955  <----- USE THIS :-)
(1 row)

Note this is from 19.2.0:

> select version();
                                         version                                         
+---------------------------------------------------------------------------------------+
  CockroachDB CCL v19.2.0 (x86_64-apple-darwin14, built 2019/11/12 05:07:10, go1.12.12)  
(1 row)

Jira Issue: DOC-372

awoods187 commented 4 years ago

This is now 4.8 seconds

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB docs!