# Artist Works in music brainz website and database gives different result

**URL:** https://community.metabrainz.org/t/artist-works-in-music-brainz-website-and-database-gives-different-result/595521
**Category:** Development
**Tags:** database
**Created:** [August 2, 2022, 7:24am UTC](https://community.metabrainz.org/t/artist-works-in-music-brainz-website-and-database-gives-different-result/595521 "2022-08-02T07:24:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![imhans4305](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/i/fbc32d/32.png) [@imhans4305](https://community.metabrainz.org/u/imhans4305)
#### Post date: [August 2, 2022, 7:24am UTC](https://community.metabrainz.org/t/artist-works-in-music-brainz-website-and-database-gives-different-result/595521/1 "2022-08-02T07:24:34Z")

</div>

I have setup musicbrainz database alone in my local machine. And when i search for a particular artist and work For example for the artist Snoop Dogg I am getting only 58 results. The query used is

```auto
select artist.name, work.name
from artist
inner join l_artist_work
ON artist.id=l_artist_work.entity0
inner join work
ON l_artist_work.entity1=work.id
where artist.name::text ILIKE '%Snoop Dogg%'

```

The result obtained in pgadmin is attached here  
 ![snoop](https://community.metabrainz.org/uploads/default/original/3X/6/2/623ff48fae1f658350d998155b3134efe13b950a.png)

But when looked at the musicbrain website there are around 320 items listed

 ![mb snoop](https://community.metabrainz.org/uploads/default/original/3X/8/c/8ce360e3b17603ce41f5e3db781d6fdc721bf887.png)

Why the difference in number when searched from database and music brainz website.  
One of my assumption is that – a work of an artist is considered as his if he is a part in writing of that work (Specified as writers for work in MB website in the image i shared above). If this is correct, then how can I pull those data also ie, not just 58 but complete 320 for snoop dogg and others too just like showing in MB website

---

<div class="post-metadata">

### Author: ![reosarevok](https://community.metabrainz.org/user_avatar/community.metabrainz.org/reosarevok/32/69228_2.png) [@reosarevok](https://community.metabrainz.org/u/reosarevok)
#### Post date: [August 2, 2022, 6:13pm UTC](https://community.metabrainz.org/t/artist-works-in-music-brainz-website-and-database-gives-different-result/595521/2 "2022-08-02T18:13:40Z")

</div>

Yes, what you have is the works as a writer (so, [the result of this filter](https://musicbrainz.org/artist/f90e8b26-9e52-4669-a5c9-e28529c47894/works?filter.type_id=&filter.name=&filter.role_type=2)).

The as-a-performer ones we get with [this query](https://github.com/metabrainz/musicbrainz-server/blob/e9914f42c2203682a3c7c4146bf44feaa3fca4a8/lib/MusicBrainz/Server/Data/Work.pm#L74) so that should be of help 🙂

---

<div class="post-metadata">

### Author: ![imhans4305](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/i/fbc32d/32.png) [@imhans4305](https://community.metabrainz.org/u/imhans4305)
#### Post date: [August 3, 2022, 5:23am UTC](https://community.metabrainz.org/t/artist-works-in-music-brainz-website-and-database-gives-different-result/595521/3 "2022-08-03T05:23:17Z")

</div>

Thank you so much @reosarevok🙂
