Question regarding the output of postgresql *explain* command

From: Arup Rakshit <aruprakshit1987(at)outlook(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Question regarding the output of postgresql *explain* command
Date: 2017-05-28 14:25:36
Message-ID: F7D0CBEF-3C12-41F1-8555-26F517E95561@outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I was reading to day how indexing works. And I was trying some query, for example below one. What the range basically means (cost=0.28..8.30 ? I don’t understand this.

———————————

arup(at)ror ~/part-time-projects/entrylvl (add_index_to_job_sources)$ rails db
psql (9.5.0)
Type "help" for help.

entrylvl_dev=# \d job_sources;
Table "public.job_sources"
Column | Type | Modifiers
---------------+-----------------------------+----------------------------------------------------------
id | bigint | not null default nextval('job_sources_id_seq'::regclass)
job_id | bigint |
source | character varying |
job_source_id | character varying |
created_at | timestamp without time zone | not null
updated_at | timestamp without time zone | not null
Indexes:
"job_sources_pkey" PRIMARY KEY, btree (id)
"index_job_sources_on_source_and_job_source_id" UNIQUE, btree (source, job_source_id)
"index_job_sources_on_job_id" btree (job_id)
Foreign-key constraints:
"fk_rails_f45da00eca" FOREIGN KEY (job_id) REFERENCES jobs(id)

entrylvl_dev=# explain select * from job_sources where job_source_id = 'p_1208b146c9eb8905' AND source = 'indeed';
QUERY PLAN
------------------------------------------------------------------------------------------------------------------
Index Scan using index_job_sources_on_source_and_job_source_id on job_sources (cost=0.28..8.30 rows=1 width=58)
Index Cond: (((source)::text = 'indeed'::text) AND ((job_source_id)::text = 'p_1208b146c9eb8905'::text))
(2 rows)

entrylvl_dev=#

—————————

Thanks,
Arup

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2017-05-28 14:53:27 Re: Help with terminology to describe what my software does please?
Previous Message Adrian Klaver 2017-05-28 13:51:07 Re: Help with terminology to describe what my software does please?