Back

How to fetch document faster?

  • 0
  • Databases
  • Self Hosted
CodingXeer01
24 Jun, 2024, 17:22

I wanna fetch a document where it checks if username == username then i want that document but it is taking around 1.2s and after indexing 1 or 1.1s

TL;DR
Developers are asking for help on how to fetch a document faster in Appwrite. They mention a response time of 1.2 seconds for getDocument and want to know how to improve it. The issue might be related to the Appwrite instance's average response time. One developer is confused about the appwrite instance and getDocument method. They mention that listDocument query is also taking 1.2 seconds. There are only 22 documents in the collection. A potential solution could be indexing to improve the fetch time.
CodingXeer01
24 Jun, 2024, 17:23

result = databases.list_documents( database_id, collection_id, [Query.equal("username", "appwrite")] )

CodingXeer01
24 Jun, 2024, 17:23

and the documents are only 22 in that collection

Joshi
24 Jun, 2024, 17:33

What's the response time for getDocument?

CodingXeer01
24 Jun, 2024, 17:47

do you mean getDocument method>

CodingXeer01
24 Jun, 2024, 17:47

?

CodingXeer01
24 Jun, 2024, 17:48

well, im not using getDocument because it needs to be pass documentID

Joshi
24 Jun, 2024, 17:49

I know I just want to know what the baseline response time is.

Joshi
24 Jun, 2024, 17:49

What's your average response time to your appwrite instance?

CodingXeer01
24 Jun, 2024, 17:55

its taking(1.2s):

result = databases.get_document( database_id, collection_id, document_id, )

CodingXeer01
24 Jun, 2024, 17:55

appwrite instance??

CodingXeer01
24 Jun, 2024, 17:56

what is that, can you bit explain it?

Joshi
24 Jun, 2024, 17:56

Whereever your appwrite is hosted, be it selfhosted or appwrite cloud

Joshi
24 Jun, 2024, 17:57

You can see that this is the time it takes appwrite for you to respond. That's why your listDocument query takes 1.2s. It can't get much faster than that

Joshi
24 Jun, 2024, 17:58

Are you using selfhosted or appwrite cloud

CodingXeer01
24 Jun, 2024, 17:58

appwrite cloud

CodingXeer01
24 Jun, 2024, 17:58

and where can i see or find " average response time" ?

Joshi
24 Jun, 2024, 17:59

I mean if it takes 1.2s for getDocument to respond then that is pretty much your response time

Joshi
24 Jun, 2024, 17:59

Where are you located?

CodingXeer01
24 Jun, 2024, 17:59

India

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more