Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:15:17+00:00 2026-06-11T18:15:17+00:00

I have a simple PostgreSQL table with a Primary Key named id and around

  • 0

I have a simple PostgreSQL table with a Primary Key named id and around 20 entries.

The following takes between 60 and 70 seconds to execute.

DELETE FROM user WHERE id = '20'

Simple SELECT queries execute in less than 10 mls which is fine.

When running EXPLAIN over the DELETE query this is the output:

"Seq Scan on user  (cost=0.00..1.26 rows=1 width=6)"
"  Filter: ((id)::text = '20'::text)"

I cannot find any explanation for those delete query taking that long. Is there something I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:15:18+00:00Added an answer on June 11, 2026 at 6:15 pm

    One probable cause is that you have a foreign key referencing this table that doesn’t have an usable index on the foreign key expression. Because you said that the type of the primary key is irregular the likely cause is that the type of the foreign key doesn’t match the type of the primary key.

    Edit: I didn’t notice at first that your table is so small that the sequential scan is normal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple SQLite table called message: sequence INTEGER PRIMARY KEY type TEXT
I am using Postgresql 8.3 and have the following simple function that will return
I have simple table creating script in Postgres 9.1. I need it to create
I have a simple SQL query in PostgreSQL 8.3 that grabs a bunch of
I have simple table in Sybase -- Creating table 'SimpleText' CREATE TABLE [dbo].[SimpleText] (
I have simple database - one table with 6 collumns. 3 of them i
Suppose you have two tables in PostgreSQL. Table A has field x , which
This is a very simple example: I have a table with two columns, id
i have recs model mapping to a recs table in postgresql, some fields are
I have a Django-created tables in PostgreSQL 8.4 database, where one table extends another.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.