Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 125758
Status: new
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: porton [...] narod.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Unclear about the difference between join and prefetch
Date: Wed, 4 Jul 2018 18:47:06 +0300
To: bug-DBIx-Class [...] rt.cpan.org
From: Victor Porton <porton [...] narod.ru>
Download (untitled) / with headers
text/plain 600b
Documentation bug: Documentation on join and prefetch is not clear. From https://stackoverflow.com/q/51160010/856090: Please explain in details the difference between join and prefetch in DBIx::Class. joins maps to JOIN in SQL, right? prefetch makes to read all data from related tables, right? But it seems for me that in the case of a has_a relationship to a table, joining and prefetching this table do exactly the same thing, add an SQL JOIN. Right? Is there any difference between join and prefetch for has_a relationships? So when to use either (especially for has_a relationships)?
Subject: Unclear about the difference between join and prefetch
Date: Wed, 4 Jul 2018 18:49:01 +0300
To: bug-DBIx-Class [...] rt.cpan.org
From: Victor Porton <porton [...] narod.ru>
Download (untitled) / with headers
text/plain 600b
Documentation bug: Documentation on join and prefetch is not clear. From https://stackoverflow.com/q/51160010/856090: Please explain in details the difference between join and prefetch in DBIx::Class. joins maps to JOIN in SQL, right? prefetch makes to read all data from related tables, right? But it seems for me that in the case of a has_a relationship to a table, joining and prefetching this table do exactly the same thing, add an SQL JOIN. Right? Is there any difference between join and prefetch for has_a relationships? So when to use either (especially for has_a relationships)?
Download (untitled) / with headers
text/plain 964b
I found that my question is answered in https://metacpan.org/pod/DBIx::Class::ResultSet#prefetch but note that it should be referenced from https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#JOINS-AND-PREFETCHING as otherwise the Cookbook is unclear. On Wed Jul 04 11:50:52 2018, PORTON wrote: Show quoted text
> Documentation bug: Documentation on join and prefetch is not clear. > > From https://stackoverflow.com/q/51160010/856090: > > Please explain in details the difference between join and prefetch in > DBIx::Class. > > joins maps to JOIN in SQL, right? > > prefetch makes to read all data from related tables, right? > > But it seems for me that in the case of a has_a relationship to a table, > joining and prefetching this table do exactly the same thing, add an SQL > JOIN. Right? Is there any difference between join and prefetch for has_a > relationships? > > So when to use either (especially for has_a relationships)?


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.