explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HlqU

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 289.175 ↑ 1.0 10 1

Limit (cost=6,705.84..6,705.84 rows=10 width=747) (actual time=289.172..289.175 rows=10 loops=1)

  • Output: artisans.societe, artisans.adresse, artisans.complement_adresse, artisans.ville, artisans.code_postal, artisans.telephone, artisans.email, artisans.siret, artisans.site_w
  • Buffers: shared hit=94080
  • Output: artisans.societe, artisans.adresse, artisans.complement_adresse, artisans.ville, artisans.code_postal, artisans.telephone, artisans.email, artisans.siret, artisans.
  • Sort Key: (('12742'::double precision * asin(sqrt((power(sin((((('48.8640493'::double precision - artisans.latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.65784794579941'::double precision * cos(((artisans.latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('2.3310526'::double precision - artisans.longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))))
  • Sort Method: top-N heapsort Memory: 35kB
  • Buffers: shared hit=94080
  • Planning time: 2.210 ms
  • Execution time: 289.528 ms
2. 12.451 289.172 ↑ 2.1 10 1

Sort (cost=6,705.84..6,705.85 rows=21 width=747) (actual time=289.170..289.172 rows=10 loops=1)

  • Output: artisans.societe, artisans.adresse, artisans.complement_adresse, artisans.ville, artisans.code_postal, artisans.telephone, artisans.email, artisans.siret, artisans.site_web, artisans.created_at, artisans.updated_at, artisans.latitude, artisans.longitude, artisans.slug, artisans.source, artisans.presentation_societe, artisans.id, artisans.entreprise_id, artisans.partenaire_qe, artisans.nombre_employes, artisans.salesforce_uid, artisans.sirene_updated_at, artisans.faire_fr_updated_at, artisans.erreur_sirene, artisans.salesforce_updated_at, artisans.token_url, artisans.societe_declaree, artisans.telephone_declare, artisans.presentation_societe_declaree, artisans.adresse_declaree, artisans.complement_adresse_declare, artisans.code_postal_declare, artisans.ville_declaree, artisans.site_web_declare, artisans.mise_a_jour_salesforce_planifiee_at, artisans.image_couverture_id, artisans.avatar_id, ('12742'::double precision * asin(sqrt((power(sin((((('48.8640493'::double precision - artisans.latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.65784794579941'::double precision * cos(((artisans.latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('2.3310526'::double precision - artisans.longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))), mod((((atan2(((artisans.longitude - '2.3310526'::double precision) / '57.2957795'::double precision), ((artisans.latitude - '48.8640493'::double precision) / '57.2957795'::double precision)) * '57.2957795'::double precision) + '360'::double precision))::numeric, '360'::numeric)
  • Inner Unique: true
  • Buffers: shared hit=94080
3. 50.227 276.721 ↓ 311.7 6,546 1

Nested Loop (cost=474.27..6,705.75 rows=21 width=747) (actual time=6.000..276.721 rows=6,546 loops=1)

  • Output: artisans.societe, artisans.adresse, artisans.complement_adresse, artisans.ville, artisans.code_postal, artisans.telephone, artisans.email, artisans.siret, artisans.site_web, artisans.created_at, artisans.updated_at, artisans.latitude, artisans.longitude, artisans.slug, artisans.source, artisans.presentation_societe, artisans.id, artisans.entreprise_id, artisans.partenaire_qe, artisans.nombre_employes, artisans.salesforce_uid, artisans.sirene_updated_at, artisans.faire_fr_updated_at, artisans.erreur_sirene, artisans.salesforce_updated_at, artisans.token_url, artisans.societe_declaree, artisans.telephone_declare, artisans.presentation_societe_declaree, artisans.adresse_declaree, artisans.complement_adresse_declare, artisans.code_postal_declare, artisans.ville_declaree, artisans.site_web_declare, artisans.mise_a_jour_salesforce_planifiee_at, artisans.image_couverture_id, artisans.avatar_id
  • Buffers: shared hit=67749
  • Output: entreprises.id
  • Index Cond: (entreprises.id = artisans.entreprise_id)
  • Filter: ((entreprises.etat_administratif)::text = 'Active'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=26331
4. 10.016 193.609 ↓ 299.0 6,577 1

Nested Loop Semi Join (cost=474.19..6,616.61 rows=22 width=707) (actual time=5.975..193.609 rows=6,577 loops=1)

  • Output: artisans.societe, artisans.adresse, artisans.complement_adresse, artisans.ville, artisans.code_postal, artisans.telephone, artisans.email, artisans.siret, artisans.site_web, artisans.created_at, artisans.updated_at, artisans.latitude, artisans.longitude, artisans.slug, artisans.source, artisans.presentation_societe, artisans.id, artisans.entreprise_id, artisans.partenaire_qe, artisans.nombre_employes, artisans.salesforce_uid, artisans.sirene_updated_at, artisans.faire_fr_updated_at, artisans.erreur_sirene, artisans.salesforce_updated_at, artisans.token_url, artisans.societe_declaree, artisans.telephone_declare, artisans.presentation_societe_declaree, artisans.adresse_declaree, artisans.complement_adresse_declare, artisans.code_postal_declare, artisans.ville_declaree, artisans.site_web_declare, artisans.mise_a_jour_salesforce_planifiee_at, artisans.image_couverture_id, artisans.avatar_id
  • Recheck Cond: ((artisans.latitude >= '47.9647276940813'::double precision) AND (artisans.latitude <= '49.7633709059187'::double precision) AND (artisans.longitude >= '0.96398653000432'::double precision) AND (artisans.longitude <= '3.69811866999568'::double precision))
  • Filter: ((('12742'::double precision * asin(sqrt((power(sin((((('48.8640493'::double precision - artisans.latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.65784794579941'::double precision * cos(((artisans.latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('2.3310526'::double precision - artisans.longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))) >= '0'::double precision) AND (('12742'::double precision * asin(sqrt((power(sin((((('48.8640493'::double precision - artisans.latitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision) + (('0.65784794579941'::double precision * cos(((artisans.latitude * '3.14159265358979'::double precision) / '180'::double precision))) * power(sin((((('2.3310526'::double precision - artisans.longitude) * '3.14159265358979'::double precision) / '180'::double precision) / '2'::double precision)), '2'::double precision)))))) <= '100'::double precision))
  • Rows Removed by Filter: 1371
  • Heap Blocks: exact=4654
  • Buffers: shared hit=4848
  • Output: qualifications_obtenues.artisan_id
  • Buffers: shared hit=62901
5. 51.587 56.717 ↓ 271.1 10,573 1

Bitmap Heap Scan on public.artisans (cost=474.05..5,966.47 rows=39 width=707) (actual time=5.937..56.717 rows=10,573 loops=1)

  • Index Cond: ((artisans.latitude >= '47.9647276940813'::double precision) AND (artisans.latitude <= '49.7633709059187'::double precision) AND (artisans.longitude >= '0.96398653000432'::double precision) AND (artisans.longitude <= '3.69811866999568'::double precision))
  • Buffers: shared hit=194
6. 5.130 5.130 ↓ 1.6 12,355 1

Bitmap Index Scan on index_artisans_on_latitude_and_longitude (cost=0.00..474.05 rows=7,899 width=0) (actual time=5.130..5.130 rows=12,355 loops=1)

7. 16.153 126.876 ↑ 2.0 1 10,573

Nested Loop Semi Join (cost=0.14..20.18 rows=2 width=16) (actual time=0.012..0.012 rows=1 loops=10,573)

  • Output: qualifications_obtenues.qualification_id, qualifications_obtenues.artisan_id
  • Index Cond: (qualifications_obtenues.artisan_id = artisans.id)
  • Filter: ((qualifications_obtenues.date_debut <= '2019-01-16'::date) AND (qualifications_obtenues.date_fin >= '2019-01-16'::date))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=47320
  • Output: operations_qualifications.qualification_id
  • Index Cond: (operations_qualifications.qualification_id = qualifications_obtenues.qualification_id)
  • Heap Fetches: 0
  • Buffers: shared hit=15581
8. 95.157 95.157 ↑ 3.0 1 10,573

Index Scan using index_qualifications_obtenues_on_artisan_id on public.qualifications_obtenues (cost=0.08..19.98 rows=3 width=32) (actual time=0.009..0.009 rows=1 loops=10,573)

9. 15.566 15.566 ↑ 3.0 1 7,783

Index Only Scan using index_operations_qualifications_on_qualification_id on public.operations_qualifications (cost=0.06..0.07 rows=3 width=16) (actual time=0.002..0.002 rows=1 loops=7,783)

10. 32.885 32.885 ↑ 1.0 1 6,577

Index Scan using entreprises_pkey on public.entreprises (cost=0.08..4.04 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=6,577)