Basic request is very slow

Hi community and team!

I’ve subscribed to a free account to trial Pinecone. I heard good things about it so I’m keen to check it out and move to a paid tier if it fits my needs. The roadblock I am facing:

I created an index and stored 10 openAI embeddings. They each contain about 6 meta data values (one of which is the actual textual content up to 500 characters). I’m using the JavaScript API to get a similarity search out. I’m using basic code supplied in the docs:

    const pinecone = new PineconeClient();
    await pinecone.init({
        environment: process.env.PINECONE_ENV!,
        apiKey: process.env.PINECONE_KEY!,
    });

    const index = pinecone.Index("docup");
    const queryRequest = {
        vector: embedding.data.data[0].embedding,
        topK: 6,
        includeValues: false,
        includeMetadata: true,
    };
    result = await index.query({ queryRequest });

Here is the issue: executing that code takes on average 2.75 seconds. So it seems the Pinecone API is performing very slow for me. The database location is Asia which is quite far from me, but still 2,8s seems too slow. Other vector databases give results below 1s. There is no lookup or DNS issue:

image

Am I missing something? Will this be solved by moving to a paid tier? Or do I need to do something else to get good performance?

Hi!

Not sure if this might be it but… when creating an index in code you can specify which metadata filed should be indexed as well (for metadata search filters etc.). Big metadata fileds like fulltext could maybe be the cause for slow searches.

If you only have 10 vectors. Maybe try destroying the index and create a new one where you only specify those metadata fields that you know you will use when filtering to be indexed and see if that solves at least some of the slowness.

Reference for creating an index: https://docs.pinecone.io/docs/node-client#createindex

Be sure to use the metadata_config:
( Configuration for the behavior of Pinecone’s internal metadata index. By default, all metadata is indexed; when metadata_config is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: {"indexed": ["example_metadata_field"]})

I think that you can not specify this if you are creating an index from the dashboard.

Hope this helps!

Thanks for your suggestion! Unfortunately, that doesn’t appear to be the issue. I destroyed the index, created a new one, added 3 embeddings without any meta data. Querying those still takes about 2.7 seconds.

Furthyer info: my internet connection is fine, connecting to the API is fast, but waiting for the response (Pinecone doing its thing) unfortunately isn’t.

Eh. Too bad :confused: Can you try doing the same with Python lib and see how fast it is? (Sorry to bother you, but this peaked my interest :sweat_smile:)

Not a python person here, sorry! I’ve done the exact same excersice with other SaaS services though (Supabase with pgvectr and Metal) and they both perform around 500ms.

1 Like

I have the same problem. I am ready to pay for the Standard subscription, but with a 2.5sec delay, it makes absolutely no sense.

No reply. No support. I have deactivated my account. It’s more stable to use my own Redis service with Vector Similarity Index - Vector similarity | Redis