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

  • Home
  • SEARCH
  • 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 6093961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:37:19+00:00 2026-05-23T12:37:19+00:00

The following is the EXPLAIN output of a query with set enable_seqscan = true.

  • 0

The following is the EXPLAIN output of a query with set enable_seqscan = true.

 Hash Join  (cost=1028288.04..278841855100.04 rows=429471108 width=125)
   Hash Cond: ((u.destination)::text = (n.mid)::text)
   ->  Nested Loop  (cost=0.00..278587474234.17 rows=429471108 width=112)
     Join Filter: (((u.destination)::text <> (u2.mid)::text) AND ("position"((u2.path_name)::text, (suffix(u.path_name))::text) = 0) AND (((prefix((u.path_name)::text))::text = (prefix((u2.path_name)::text))::text) OR ((prefix((u.path_name)::text))::text = 'common'::text)))
     ->  Seq Scan on unresolved u2  (cost=0.00..2780546.32 rows=117608632 width=79)
     ->  Index Scan using unresolved__mid on unresolved u  (cost=0.00..1864.44 rows=492 width=53)
           Index Cond: ((u.mid)::text = (u2.destination)::text)
   ->  Hash  (cost=488335.24..488335.24 rows=27237024 width=33)
     ->  Seq Scan on name n  (cost=0.00..488335.24 rows=27237024 width=33)

(9 rows)

The following is the EXPLAIN output of the same query but with set enable_seqscan = false.

 Hash Join  (cost=102089128.45..279381508122.13 rows=429471108 width=125)
   Hash Cond: ((u.destination)::text = (n.mid)::text)
   ->  Nested Loop  (cost=0.00..279026066415.86 rows=429471108 width=112)
     Join Filter: (((u.destination)::text <> (u2.mid)::text) AND ("position"((u2.path_name)::text, (suffix(u.path_name))::text) = 0) AND (((prefix((u.path_name)::text))::text = (prefix((u2.path_name)::text))::text) OR ((prefix((u.path_name)::text))::text = 'common'::text)))
     ->  Index Scan using unresolved__destination on unresolved u2  (cost=0.00..441372728.01 rows=117608632 width=79)
     ->  Index Scan using unresolved__mid on unresolved u  (cost=0.00..1864.44 rows=492 width=53)
           Index Cond: ((u.mid)::text = (u2.destination)::text)
   ->  Hash  (cost=101549175.65..101549175.65 rows=27237024 width=33)
     ->  Index Scan using name_pkey on name n  (cost=0.00..101549175.65 rows=27237024 width=33)

(9 rows)

I would like to know how long would the query take. It’s been running for about 10 hours now. Is the estimated time deduced from the ‘cost’ in the first row, in the case of the latter it is ‘279381508122.13 ms’ which is 8.8 years?! 🙁

  • 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-05-23T12:37:20+00:00Added an answer on May 23, 2026 at 12:37 pm

    The numbers do not correspond to time. They are relative numbers only. From the documentation (Using Explain):

    The costs are measured in arbitrary
    units determined by the planner’s cost
    parameters (see Section 18.6.2).
    Traditional practice is to measure the
    costs in units of disk page fetches;
    that is, seq_page_cost is
    conventionally set to 1.0 and the
    other cost parameters are set relative
    to that. (The examples in this section
    are run with the default cost
    parameters.)

    In any event, the Nested Loop due to a somewhat vague join condition appears to be killing your performance. Hard to tell without seeing the original query and table/index structures, but you might find benefit in creating a functional index on unresolved, assuming “prefix()” is an IMMUTABLE function:

    CREATE INDEX idx_path_name_prefix ON unresolved (prefix(path_name));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone help explain the following: If I type: a=`ls -l` Then the output
I have a query with regards to pointers, can someone help explain the following
I tried this and got the output as: void Please explain the following Code:
Could someone please explain why following program will output 4,6 instead of 4,4. MainProgram()
Please see the following code and explain the output behavior. public class MyFinalTest {
Can someone explain the output of the following code? #include <iostream> template <class T>
I am puzzled by the output of the following query: select 'Eq Type' =
Can anyone explain why following code won't compile? At least on g++ 4.2.4. And
Can anyone explain the following PHP Code ? function get_param($param_name, $param_type = 0) {
Can anyone explain the following behaviour to a relative newbie... const char cInputFilenameAndPath[] =

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.